-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
Delete.ts
28 lines (25 loc) · 864 Bytes
/
Delete.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { getMetadataArgsStorage } from "../mod.ts";
/**
* Registers an action to be executed when Delete request comes on a given route.
* Must be applied on a controller action.
*/
export function Delete(route?: RegExp): Function;
/**
* Registers an action to be executed when Delete request comes on a given route.
* Must be applied on a controller action.
*/
export function Delete(route?: string): Function;
/**
* Registers an action to be executed when Delete request comes on a given route.
* Must be applied on a controller action.
*/
export function Delete(route?: string|RegExp): Function {
return function (object: Object, methodName: string) {
getMetadataArgsStorage().actions.push({
type: "DELETE",
target: object.constructor,
method: methodName,
route: route
});
};
}