MCPcopy Index your code
hub / github.com/codecombat/codecombat / onClickDeny

Method onClickDeny

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

Source from the content-addressed store, hash-verified

78 }
79
80 onClickDeny (e) {
81 const trialRequestID = $(e.target).data('trial-request-id')
82 const trialRequest = _.find(this.trialRequests.models, a => a.id === trialRequestID)
83 if (!trialRequest) {
84 console.error('Could not find trial request model for', trialRequestID)
85 return
86 }
87 if (!window.confirm(`Deny ${trialRequest.get('properties').email}?`)) { return }
88 trialRequest.set('status', 'denied')
89 return trialRequest.patch({
90 error: (model, response, options) => {
91 return console.error('Error patching trial request', response)
92 },
93 success: (model, response, options) => {
94 return (typeof this.render === 'function' ? this.render() : undefined)
95 }
96 })
97 }
98 }
99 TrialRequestsView.initClass()
100 return TrialRequestsView

Callers

nothing calls this directly

Calls 6

dataMethod · 0.80
patchMethod · 0.80
errorMethod · 0.45
getMethod · 0.45
setMethod · 0.45
renderMethod · 0.45

Tested by

no test coverage detected