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

Method savePoll

app/views/editor/poll/PollEditView.js:149–168  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

147 }
148
149 savePoll (e) {
150 this.treema.endExistingEdits()
151 for (const key in this.treema.data) {
152 const value = this.treema.data[key]
153 this.poll.set(key, value)
154 }
155
156 return this.validateNextPollIds(this.poll.get('answers')).then(() => {
157 const res = this.poll.save()
158
159 res.error((collection, response, options) => {
160 return console.error(response)
161 })
162
163 return res.success(() => {
164 const url = `/editor/poll/${this.poll.get('slug') || this.poll.id}`
165 return document.location.href = url
166 })
167 })
168 }
169
170 confirmDeletion () {
171 const renderData = {

Callers

nothing calls this directly

Calls 6

validateNextPollIdsMethod · 0.95
setMethod · 0.45
getMethod · 0.45
saveMethod · 0.45
errorMethod · 0.45
successMethod · 0.45

Tested by

no test coverage detected