Merge branch 'develop' into adiDev
This commit is contained in:
commit
f5c5d21a3e
1 changed files with 25 additions and 18 deletions
|
|
@ -97,14 +97,25 @@ export class PositionController extends Controller {
|
||||||
select: [
|
select: [
|
||||||
"id",
|
"id",
|
||||||
"posTypeName",
|
"posTypeName",
|
||||||
"posTypeRank",
|
"posTypeRank"
|
||||||
"posLevels"
|
],
|
||||||
]
|
relations: ["posLevels"],
|
||||||
});
|
});
|
||||||
if (!posType) {
|
if (!posType) {
|
||||||
return new HttpSuccess([]);
|
return new HttpSuccess([]);
|
||||||
}
|
}
|
||||||
return new HttpSuccess(posType);
|
const mapPosType = posType.map(item => ({
|
||||||
|
id: item.id,
|
||||||
|
posTypeName: item.posTypeName,
|
||||||
|
posTypeRank: item.posTypeRank,
|
||||||
|
posLevels: item.posLevels.map((posLevel) => ({
|
||||||
|
id: posLevel.id,
|
||||||
|
posLevelName: posLevel.posLevelName,
|
||||||
|
posLevelRank: posLevel.posLevelRank,
|
||||||
|
posLevelAuthority: posLevel.posLevelAuthority
|
||||||
|
}))
|
||||||
|
}));
|
||||||
|
return new HttpSuccess(mapPosType);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
@ -123,13 +134,11 @@ export class PositionController extends Controller {
|
||||||
posLevelName: "นักบริหาร",
|
posLevelName: "นักบริหาร",
|
||||||
posLevelRank: 1,
|
posLevelRank: 1,
|
||||||
posLevelAuthority: "HEAD",
|
posLevelAuthority: "HEAD",
|
||||||
posTypes: [
|
posTypes: {
|
||||||
{
|
id: "00000000-0000-0000-0000-000000000000",
|
||||||
id: "00000000-0000-0000-0000-000000000000",
|
posTypeName: "นักบริหาร",
|
||||||
posTypeName: "นักบริหาร",
|
posTypeRank: 1
|
||||||
posTypeRank: 1
|
}
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
async GetPosLevel() {
|
async GetPosLevel() {
|
||||||
|
|
@ -152,13 +161,11 @@ export class PositionController extends Controller {
|
||||||
posLevelName: item.posLevelName,
|
posLevelName: item.posLevelName,
|
||||||
posLevelRank: item.posLevelRank,
|
posLevelRank: item.posLevelRank,
|
||||||
posLevelAuthority: item.posLevelAuthority,
|
posLevelAuthority: item.posLevelAuthority,
|
||||||
posTypes: [
|
posTypes: {
|
||||||
{
|
id: item.posType.id,
|
||||||
id: item.posType.id,
|
posTypeName: item.posType.posTypeName,
|
||||||
posTypeName: item.posType.posTypeName,
|
posTypeRank: item.posType.posTypeRank,
|
||||||
posTypeRank: item.posType.posTypeRank,
|
}
|
||||||
}
|
|
||||||
]
|
|
||||||
}));
|
}));
|
||||||
return new HttpSuccess(mapPosLevel);
|
return new HttpSuccess(mapPosLevel);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue