checkpoint
This commit is contained in:
parent
bbc700478c
commit
71b618e3a8
1 changed files with 53 additions and 8 deletions
|
|
@ -21,6 +21,8 @@ import HttpSuccess from "../interfaces/http-success";
|
|||
import { CreateOrgChild1, OrgChild1 } from "../entities/OrgChild1";
|
||||
import HttpError from "../interfaces/http-error";
|
||||
import HttpStatusCode from "../interfaces/http-status";
|
||||
import { createConnection } from "net";
|
||||
import { OrgRoot } from "../entities/OrgRoot";
|
||||
|
||||
@Route("api/v1/org")
|
||||
@Tags("Organization")
|
||||
|
|
@ -120,13 +122,56 @@ export class OrganizationController extends Controller {
|
|||
* @summary ORG_023 - รายละเอียดโครงสร้าง (ADMIN) #25
|
||||
*
|
||||
*/
|
||||
// @Get()
|
||||
// async detail(@Path() id: string) {
|
||||
// try {
|
||||
@Get("{id}")
|
||||
async detail(@Path() id: string) {
|
||||
|
||||
try {
|
||||
|
||||
// return new HttpSuccess();
|
||||
// } catch (error) {
|
||||
// return error;
|
||||
// }
|
||||
// }
|
||||
const orgRevisionData = await AppDataSource.getRepository(OrgRevision)
|
||||
.createQueryBuilder("orgRevision")
|
||||
// .leftJoin("orgRevision.orgRoots", "orgRoot")
|
||||
// .leftJoin("orgRoot.orgChild1s", "orgChild1")
|
||||
// .leftJoin("orgChild1.orgChild2s", "orgChild2")
|
||||
// .leftJoin("orgChild2.orgChild3s", "orgChild3")
|
||||
// .leftJoin("orgChild3.orgChild4s", "orgChild4")
|
||||
.where("orgRevision.id = :id", { id })
|
||||
// .select([
|
||||
// "orgRoot.id",
|
||||
// "orgRoot.orgRootName",
|
||||
// "orgRoot.orgRootShortName",
|
||||
// "orgRoot.orgRootCode",
|
||||
// "orgRoot.orgRootOrder",
|
||||
|
||||
// "orgChild1.id",
|
||||
// "orgChild1.orgChild1Name",
|
||||
// "orgChild1.orgChild1ShortName",
|
||||
// "orgChild1.orgChild1Code",
|
||||
// "orgChild1.orgChild1Order",
|
||||
|
||||
// "orgChild2.id",
|
||||
// "orgChild2.orgChild2Name",
|
||||
// "orgChild2.orgChild2ShortName",
|
||||
// "orgChild2.orgChild2Code",
|
||||
// "orgChild2.orgChild2Order",
|
||||
|
||||
// "orgChild3.id",
|
||||
// "orgChild3.orgChild3Name",
|
||||
// "orgChild3.orgChild3ShortName",
|
||||
// "orgChild3.orgChild3Code",
|
||||
// "orgChild3.orgChild3Order",
|
||||
|
||||
// "orgChild4.id",
|
||||
// "orgChild4.orgChild4Name",
|
||||
// "orgChild4.orgChild4ShortName",
|
||||
// "orgChild4.orgChild4Code",
|
||||
// "orgChild4.orgChild4Order",
|
||||
// ])
|
||||
.getOne();
|
||||
|
||||
|
||||
return new HttpSuccess(orgRevisionData);
|
||||
} catch (error) {
|
||||
return error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue