updated api after test connect frontend
This commit is contained in:
parent
4b55b8cf20
commit
b48df26505
10 changed files with 275 additions and 73 deletions
|
|
@ -451,6 +451,7 @@ export class AssignController extends Controller {
|
|||
lists.map(async (item) => {
|
||||
const director = await this.assignDirectorRepository.find({
|
||||
where: { assign_id: item.id },
|
||||
order: { ordering: "ASC" },
|
||||
});
|
||||
|
||||
let mentors = "";
|
||||
|
|
@ -500,6 +501,7 @@ export class AssignController extends Controller {
|
|||
"round_no",
|
||||
"date_start",
|
||||
"date_finish",
|
||||
"other_desc",
|
||||
"other4_desc",
|
||||
"other5_no1_desc",
|
||||
"experimenter_dated",
|
||||
|
|
@ -575,12 +577,21 @@ export class AssignController extends Controller {
|
|||
where: { active: 1 },
|
||||
});
|
||||
|
||||
const laws = await lawData.map((x) => ({
|
||||
id: x.id,
|
||||
selected: x.assignLaw ? 1 : 0,
|
||||
description: x.description,
|
||||
status_select: x.status_select,
|
||||
}));
|
||||
const laws = await Promise.all(
|
||||
lawData.map(async (x) => {
|
||||
const assignLaw = await this.assignLawRepository.countBy({
|
||||
assign_id: assign_id,
|
||||
law_id: x.id,
|
||||
});
|
||||
|
||||
return {
|
||||
id: x.id,
|
||||
selected: assignLaw > 0 ? 1 : 0,
|
||||
description: x.description,
|
||||
status_select: x.status_select,
|
||||
};
|
||||
}),
|
||||
);
|
||||
|
||||
const skillsData = await this.assignSkillRepository.find({
|
||||
relations: ["skill"],
|
||||
|
|
@ -640,6 +651,7 @@ export class AssignController extends Controller {
|
|||
|
||||
const director = await this.assignDirectorRepository.find({
|
||||
where: { assign_id },
|
||||
order: { ordering: "ASC" },
|
||||
});
|
||||
|
||||
let mentors = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue