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",
|
||||
repository: this.profileRepository,
|
||||
description: "ข้อมูลหลัก",
|
||||
isMain: true,
|
||||
system: ["registry"],
|
||||
},
|
||||
{
|
||||
name: "ProfileEmployee",
|
||||
repository: this.profileEmployeeRepository,
|
||||
description: "ข้อมูลหลัก",
|
||||
isMain: true,
|
||||
system: ["registry_emp", "registry_temp"],
|
||||
},
|
||||
{
|
||||
|
|
@ -257,6 +259,7 @@ export class ApiManageController extends Controller {
|
|||
name: "OrgRoot",
|
||||
repository: this.orgRootRepository,
|
||||
description: "ข้อมูลหน่วยงาน",
|
||||
isMain: true,
|
||||
system: ["organization"],
|
||||
},
|
||||
{
|
||||
|
|
@ -293,9 +296,10 @@ export class ApiManageController extends Controller {
|
|||
|
||||
const result = entities
|
||||
.filter((s) => s.system.includes(system))
|
||||
.map(({ name, repository, description }) => ({
|
||||
.map(({ name, repository, description, isMain }) => ({
|
||||
tb: name,
|
||||
description,
|
||||
isMain: isMain || false,
|
||||
propertys: repository.metadata.columns
|
||||
.filter(
|
||||
(column) =>
|
||||
|
|
@ -305,9 +309,9 @@ export class ApiManageController extends Controller {
|
|||
)
|
||||
.map((column) => ({
|
||||
propertyName: column.propertyName,
|
||||
type: column.type,
|
||||
type: typeof column.type === "string" ? column.type : "string",
|
||||
comment: column.comment,
|
||||
key: `${name}.${column.propertyName}`,
|
||||
key: column.propertyName,
|
||||
})),
|
||||
}));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue