แก้ตัวแปรเครื่องราช

This commit is contained in:
Kittapath 2024-06-10 09:39:13 +07:00
parent 364d1fc1a7
commit c75c3ef651

View file

@ -219,7 +219,7 @@ export class InsigniaController extends Controller {
*
*/
@Put("sort/{insigniaTypeId}")
async Sort(@Path() insigniaTypeId: string, @Body() requestBody: { sortId: string[] }) {
async Sort(@Path() insigniaTypeId: string, @Body() requestBody: { id: string[] }) {
const insigniaType = await this.insigniaTypeRepository.findOne({
where: { id: insigniaTypeId },
});
@ -237,7 +237,7 @@ export class InsigniaController extends Controller {
const sortLevel = insignia.map((data) => ({
id: data.id,
level: requestBody.sortId.indexOf(data.id) + 1,
level: requestBody.id.indexOf(data.id) + 1,
}));
await this.insigniaRepository.save(sortLevel);