checkpoint and fix bug

This commit is contained in:
AdisakKanthawilang 2024-01-31 17:22:45 +07:00
parent 24d0d06b62
commit 2610bd74b4
2 changed files with 57 additions and 3 deletions

View file

@ -690,4 +690,58 @@ export class PositionController extends Controller {
return error;
}
}
/**
* API
*
* @summary ORG_053 - (ADMIN) #56
*
*/
@Post("master/list")
async list(
@Body()
body: {
id: string;
type: number;
// isAll: boolean;
// page: number;
// pageSize: number;
// keyword?: string;
},
) {
try {
let typeCondition: any = {};
if (body.type === 0) {
typeCondition = {
orgRootId: body.id,
};
} else if (body.type === 1) {
typeCondition = {
orgChild1Id: body.id,
};
} else if (body.type === 2) {
typeCondition = {
orgChild2Id: body.id,
};
} else if (body.type === 3) {
typeCondition = {
orgChild3Id: body.id,
};
} else if (body.type === 4) {
typeCondition = {
orgChild4Id: body.id,
};
}
const posMaster = await this.posMasterRepository.find({
where: typeCondition,
// relations: ["position"]
});
return new HttpSuccess(posMaster);
} catch (error) {
return error;
}
}
}