fix(surgery-type): fix the list from clause
This commit is contained in:
@ -47,7 +47,7 @@ export class SurgeryTypeController {
|
||||
|
||||
const res_count = query;
|
||||
const res_list = query
|
||||
.orderBy("SurgeryType." + param.order_field, param.order_direction)
|
||||
.orderBy("st." + param.order_field, param.order_direction)
|
||||
.offset(offset)
|
||||
.limit(limit);
|
||||
|
||||
@ -110,7 +110,7 @@ export class SurgeryTypeController {
|
||||
|
||||
let param: { id: string } = await schema.validateAsync(req.params);
|
||||
|
||||
let surgeryType = await SurgeryTypeModel.list({ "SurgeryType.id": param.id }).then((q) => q.getOne());
|
||||
let surgeryType = await SurgeryTypeModel.list({ "st.id": param.id }).then((q) => q.getOne());
|
||||
|
||||
if (!surgeryType) throw { message: "Surgery Type " + Language.lang.failed_not_found };
|
||||
|
||||
@ -142,7 +142,7 @@ export class SurgeryTypeController {
|
||||
let exist = await SurgeryTypeModel.list({ name: param.name }).then((q) => q.getOne());
|
||||
if (exist && exist.id != param.id) throw { message: "Surgery Type " + Language.lang.failed_duplicate };
|
||||
|
||||
let surgeryType = await SurgeryTypeModel.list({ "SurgeryType.id": param.id }).then((q) => q.getOne());
|
||||
let surgeryType = await SurgeryTypeModel.list({ "st.id": param.id }).then((q) => q.getOne());
|
||||
|
||||
if (!surgeryType) throw { message: "Surgery Type " + Language.lang.failed_not_found };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user