MCPcopy Create free account
hub / github.com/WebThingsIO/webthing-node / delete

Method delete

lib/server.ts:587–602  ·  view source on GitHub ↗

* Handle a DELETE request. * * @param {Object} req The request object * @param {Object} res The response object

(req: express.Request, res: express.Response)

Source from the content-addressed store, hash-verified

585 * @param {Object} res The response object
586 */
587 delete(req: express.Request, res: express.Response): void {
588 const thing = this.getThing(req);
589 if (thing === null) {
590 res.status(404).end();
591 return;
592 }
593
594 const actionName = req.params.actionName;
595 const actionId = req.params.actionId;
596
597 if (thing.removeAction(actionName, actionId)) {
598 res.status(204).end();
599 } else {
600 res.status(404).end();
601 }
602 }
603}
604
605/**

Callers 3

constructorMethod · 0.95
removeSubscriberMethod · 0.80
removeEventSubscriberMethod · 0.80

Calls 2

removeActionMethod · 0.80
getThingMethod · 0.45

Tested by

no test coverage detected