แก้format profile development
This commit is contained in:
parent
1e1dbfd519
commit
eb60576a77
1 changed files with 45 additions and 3 deletions
|
|
@ -45,7 +45,21 @@ export class ProfileDevelopmentController extends Controller {
|
|||
where: { profileId: profile.id },
|
||||
relations: ["developmentProjects"],
|
||||
});
|
||||
return new HttpSuccess(lists);
|
||||
const _lists = lists.map((item) => ({
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
target: item.target,
|
||||
summary: item.summary,
|
||||
point: item.point,
|
||||
developmentProjects: item.developmentProjects.map((x) => x.name),
|
||||
achievement10: item.achievement10,
|
||||
achievement5: item.achievement5,
|
||||
achievement0: item.achievement0,
|
||||
isDevelopment70: item.isDevelopment70,
|
||||
isDevelopment20: item.isDevelopment20,
|
||||
isDevelopment10: item.isDevelopment10,
|
||||
}));
|
||||
return new HttpSuccess(_lists);
|
||||
}
|
||||
|
||||
@Get("{profileId}")
|
||||
|
|
@ -70,7 +84,21 @@ export class ProfileDevelopmentController extends Controller {
|
|||
where: { profileId: profileId },
|
||||
relations: ["developmentProjects"],
|
||||
});
|
||||
return new HttpSuccess(lists);
|
||||
const _lists = lists.map((item) => ({
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
target: item.target,
|
||||
summary: item.summary,
|
||||
point: item.point,
|
||||
developmentProjects: item.developmentProjects.map((x) => x.name),
|
||||
achievement10: item.achievement10,
|
||||
achievement5: item.achievement5,
|
||||
achievement0: item.achievement0,
|
||||
isDevelopment70: item.isDevelopment70,
|
||||
isDevelopment20: item.isDevelopment20,
|
||||
isDevelopment10: item.isDevelopment10,
|
||||
}));
|
||||
return new HttpSuccess(_lists);
|
||||
}
|
||||
|
||||
@Get("history/{developmentId}")
|
||||
|
|
@ -102,7 +130,21 @@ export class ProfileDevelopmentController extends Controller {
|
|||
relations: ["developmentHistoryProjects"],
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
const _lists = record.map((item) => ({
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
target: item.target,
|
||||
summary: item.summary,
|
||||
point: item.point,
|
||||
developmentProjects: item.developmentHistoryProjects.map((x) => x.name),
|
||||
achievement10: item.achievement10,
|
||||
achievement5: item.achievement5,
|
||||
achievement0: item.achievement0,
|
||||
isDevelopment70: item.isDevelopment70,
|
||||
isDevelopment20: item.isDevelopment20,
|
||||
isDevelopment10: item.isDevelopment10,
|
||||
}));
|
||||
return new HttpSuccess(_lists);
|
||||
}
|
||||
|
||||
@Post()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue