(aHook)
| 165 | } |
| 166 | |
| 167 | updateHook(aHook) { |
| 168 | if (aHook.functionName) { |
| 169 | return this.getFunction(aHook.functionName).then(result => { |
| 170 | if (result) { |
| 171 | return this.createOrUpdateHook(aHook); |
| 172 | } |
| 173 | throw new Parse.Error(143, `no function named: ${aHook.functionName} is defined`); |
| 174 | }); |
| 175 | } else if (aHook.className && aHook.triggerName) { |
| 176 | return this.getTrigger(aHook.className, aHook.triggerName).then(result => { |
| 177 | if (result) { |
| 178 | return this.createOrUpdateHook(aHook); |
| 179 | } |
| 180 | throw new Parse.Error(143, `class ${aHook.className} does not exist`); |
| 181 | }); |
| 182 | } |
| 183 | throw new Parse.Error(143, 'invalid hook declaration'); |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | function wrapToHTTPRequest(hook, key) { |
nothing calls this directly
no test coverage detected