diff --git a/src/controllers/InsigniaController.ts b/src/controllers/InsigniaController.ts index 0068234a..420d1ca9 100644 --- a/src/controllers/InsigniaController.ts +++ b/src/controllers/InsigniaController.ts @@ -218,10 +218,10 @@ export class InsigniaController extends Controller { * @summary ORG_038 - จัดลำดับแสดงผลเครื่องราชอิสริยาภรณ์ (ADMIN) # * */ - @Post("sort") - async Sort(@Body() requestBody: { insigniaTypeId: string; sortId: string[] }) { + @Put("sort/{insigniaTypeId}") + async Sort(@Path() insigniaTypeId: string, @Body() requestBody: { sortId: string[] }) { const insigniaType = await this.insigniaTypeRepository.findOne({ - where: { id: requestBody.insigniaTypeId }, + where: { id: insigniaTypeId }, }); if (!insigniaType) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลลำดับเครื่องราชอิสริยาภรณ์นี้"); @@ -229,7 +229,7 @@ export class InsigniaController extends Controller { const insignia = await this.insigniaRepository.find({ select: ["id", "level"], - where: { insigniaTypeId: requestBody.insigniaTypeId }, + where: { insigniaTypeId: insigniaTypeId }, }); if (!insignia) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลเครื่องราชอิสริยาภรณ์นี้");