api manage add isMain table & fix type & key
This commit is contained in:
parent
321896f94b
commit
537d70a8f3
1 changed files with 7 additions and 3 deletions
|
|
@ -131,12 +131,14 @@ export class ApiManageController extends Controller {
|
||||||
name: "Profile",
|
name: "Profile",
|
||||||
repository: this.profileRepository,
|
repository: this.profileRepository,
|
||||||
description: "ข้อมูลหลัก",
|
description: "ข้อมูลหลัก",
|
||||||
|
isMain: true,
|
||||||
system: ["registry"],
|
system: ["registry"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "ProfileEmployee",
|
name: "ProfileEmployee",
|
||||||
repository: this.profileEmployeeRepository,
|
repository: this.profileEmployeeRepository,
|
||||||
description: "ข้อมูลหลัก",
|
description: "ข้อมูลหลัก",
|
||||||
|
isMain: true,
|
||||||
system: ["registry_emp", "registry_temp"],
|
system: ["registry_emp", "registry_temp"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -257,6 +259,7 @@ export class ApiManageController extends Controller {
|
||||||
name: "OrgRoot",
|
name: "OrgRoot",
|
||||||
repository: this.orgRootRepository,
|
repository: this.orgRootRepository,
|
||||||
description: "ข้อมูลหน่วยงาน",
|
description: "ข้อมูลหน่วยงาน",
|
||||||
|
isMain: true,
|
||||||
system: ["organization"],
|
system: ["organization"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -293,9 +296,10 @@ export class ApiManageController extends Controller {
|
||||||
|
|
||||||
const result = entities
|
const result = entities
|
||||||
.filter((s) => s.system.includes(system))
|
.filter((s) => s.system.includes(system))
|
||||||
.map(({ name, repository, description }) => ({
|
.map(({ name, repository, description, isMain }) => ({
|
||||||
tb: name,
|
tb: name,
|
||||||
description,
|
description,
|
||||||
|
isMain: isMain || false,
|
||||||
propertys: repository.metadata.columns
|
propertys: repository.metadata.columns
|
||||||
.filter(
|
.filter(
|
||||||
(column) =>
|
(column) =>
|
||||||
|
|
@ -305,9 +309,9 @@ export class ApiManageController extends Controller {
|
||||||
)
|
)
|
||||||
.map((column) => ({
|
.map((column) => ({
|
||||||
propertyName: column.propertyName,
|
propertyName: column.propertyName,
|
||||||
type: column.type,
|
type: typeof column.type === "string" ? column.type : "string",
|
||||||
comment: column.comment,
|
comment: column.comment,
|
||||||
key: `${name}.${column.propertyName}`,
|
key: column.propertyName,
|
||||||
})),
|
})),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue