ปรับชื่อตัวแปร method => action

This commit is contained in:
Bright 2024-08-16 11:44:08 +07:00
parent ee9d492e27
commit 4468704f57

View file

@ -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);
}
}