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

Method deletePoll

app/views/editor/poll/PollEditView.js:183–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

181 }
182
183 deletePoll () {
184 console.debug('deleting')
185 return $.ajax({
186 type: 'DELETE',
187 success () {
188 noty({
189 timeout: 5000,
190 text: 'Aaaand it\'s gone.',
191 type: 'success',
192 layout: 'topCenter'
193 })
194 return _.delay(() => application.router.navigate('/editor/poll', { trigger: true })
195 , 500)
196 },
197 error (jqXHR, status, error) {
198 console.error(jqXHR)
199 return {
200 timeout: 5000,
201 text: `Deleting poll failed with error code ${jqXHR.status}`,
202 type: 'error',
203 layout: 'topCenter'
204 }
205 },
206 url: `/db/poll/${this.poll.id}`
207 })
208 }
209 }
210 PollEditView.initClass()
211 return PollEditView

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected