Allows to define custom class name in CoffeeScript when frontend and backend class names don't match

This commit is contained in:
Mantas Masalskis 2019-12-23 11:10:16 +01:00 committed by Martin Edenhofer
parent ebe4746ace
commit 14dfdb4db9
2 changed files with 5 additions and 3 deletions

View file

@ -806,7 +806,7 @@ set new attributes of model (remove already available attributes)
type: 'GET'
url: "#{@apiPath}/tags"
data:
object: @.className
object: @serverClassName || @className
o_id: id
processData: true
success: (data, status, xhr) ->
@ -818,7 +818,7 @@ set new attributes of model (remove already available attributes)
type: 'GET'
url: "#{@apiPath}/tags/add"
data:
object: @.className
object: @serverClassName || @className
o_id: id
item: item
processData: true
@ -829,7 +829,7 @@ set new attributes of model (remove already available attributes)
type: 'GET'
url: "#{@apiPath}/tags/remove"
data:
object: @.className
object: @serverClassName || @className
o_id: id
item: item
processData: true

View file

@ -4,6 +4,8 @@ class App.KnowledgeBaseAnswer extends App.Model
@extend App.KnowledgeBaseActions
@extend App.KnowledgeBaseCanBePublished
@serverClassName: 'KnowledgeBase::Answer'
url: ->
@knowledge_base().generateURL('answers')