สร้างโครงสร้าง
This commit is contained in:
parent
042422938c
commit
8184152ac0
16 changed files with 295 additions and 84 deletions
|
|
@ -41,7 +41,7 @@ export class OrgChild4Controller extends Controller {
|
|||
* @summary ORG_013 - สร้างโครงสร้างระดับ4 (ADMIN) #13
|
||||
*
|
||||
*/
|
||||
@Post("child4")
|
||||
@Post()
|
||||
@Example([
|
||||
{
|
||||
orgChild4Name: "string", //ชื่อหน่วยงาน
|
||||
|
|
@ -83,6 +83,7 @@ export class OrgChild4Controller extends Controller {
|
|||
child4.orgRootId = String(child3?.orgRootId);
|
||||
child4.orgChild1Id = String(child3?.orgChild1Id);
|
||||
child4.orgChild2Id = String(child3?.orgChild2Id);
|
||||
child4.orgRevisionId = String(child3?.orgRevisionId);
|
||||
child4.orgChild3Id = String(child3?.id);
|
||||
await this.child4Repository.save(child4);
|
||||
|
||||
|
|
@ -99,7 +100,7 @@ export class OrgChild4Controller extends Controller {
|
|||
*
|
||||
* @param {string} id Guid, *Id Child4
|
||||
*/
|
||||
@Put("child4/{id}")
|
||||
@Put("{id}")
|
||||
@Example([
|
||||
{
|
||||
orgChild4Name: "string", //ชื่อหน่วยงาน
|
||||
|
|
@ -145,6 +146,8 @@ export class OrgChild4Controller extends Controller {
|
|||
child4.lastUpdatedAt = new Date();
|
||||
child4.orgRootId = String(child3IdExits?.orgRootId);
|
||||
child4.orgChild1Id = String(child3IdExits?.orgChild1Id);
|
||||
child4.orgChild2Id = String(child3IdExits?.orgChild2Id);
|
||||
child4.orgRevisionId = String(child3IdExits?.orgRevisionId);
|
||||
child4.orgChild3Id = String(child3IdExits?.id);
|
||||
this.child4Repository.merge(child4, requestBody);
|
||||
await this.child4Repository.save(child4);
|
||||
|
|
@ -161,7 +164,7 @@ export class OrgChild4Controller extends Controller {
|
|||
*
|
||||
* @param {string} id Guid, *Id Child4
|
||||
*/
|
||||
@Delete("child4/{id}")
|
||||
@Delete("{id}")
|
||||
async delete(@Path() id: string) {
|
||||
try {
|
||||
const child4 = await this.child4Repository.findOne({ where: { id } });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue