MCPcopy Create free account
hub / github.com/codecombat/codecombat / onClickSaveButton

Method onClickSaveButton

app/views/common/EditView.js:80–97  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

78 }
79
80 onClickSaveButton (e) {
81 this.treema.endExistingEdits()
82 for (const key in this.treema.data) {
83 const value = this.treema.data[key]
84 this.resource.set(key, value)
85 }
86 this.resource.updateI18NCoverage()
87 const res = this.resource.save()
88
89 res.error((collection, response, options) => {
90 return console.error(response)
91 })
92
93 return res.success(() => {
94 const url = `${this.redirectPathOnSuccess}/${this.resource.get('slug') || this.resource.id}`
95 document.location.href = url
96 })
97 }
98 }
99 EditView.initClass()
100 return EditView

Callers

nothing calls this directly

Calls 6

setMethod · 0.45
updateI18NCoverageMethod · 0.45
saveMethod · 0.45
errorMethod · 0.45
successMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected