ปรับชื่อตัวแปร method => action
This commit is contained in:
parent
ee9d492e27
commit
4468704f57
1 changed files with 6 additions and 6 deletions
|
|
@ -192,21 +192,21 @@ export class PermissionController extends Controller {
|
|||
/**
|
||||
* API permission (dotnet api)
|
||||
* @summary permission (dotnet api)
|
||||
* @param {string} method Method
|
||||
* @param {string} action action
|
||||
* @param {string} system authSysId
|
||||
*/
|
||||
@Get("dotnet/{method}/{system}")
|
||||
@Get("dotnet/{action}/{system}")
|
||||
public async dotnet(
|
||||
@Request() req: RequestWithUser,
|
||||
@Path() method: string,
|
||||
@Path() action: string,
|
||||
@Path() system: string
|
||||
) {
|
||||
|
||||
if(!["CREATE", "DELETE", "GET", "LIST", "UPDATE"].includes(method)) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "Method ไม่ถูกต้อง");
|
||||
if(!["CREATE", "DELETE", "GET", "LIST", "UPDATE"].includes(action)) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "Action ไม่ถูกต้อง");
|
||||
}
|
||||
|
||||
let res = await new permission().Permission(req, system.toLocaleUpperCase(), method);
|
||||
let res = await new permission().Permission(req, system.toLocaleUpperCase(), action);
|
||||
return new HttpSuccess(res);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue