forked from jappel/leistungsbilanz-ts
Add logical distribution board feed links
This commit is contained in:
parent
b50c00c0ac
commit
b893c72534
23 changed files with 3732 additions and 45 deletions
|
|
@ -69,6 +69,8 @@ export async function createDistributionBoard(req: Request, res: Response) {
|
|||
location: null,
|
||||
fedFrom: null,
|
||||
remark: null,
|
||||
feedingDistributionBoardId: null,
|
||||
feedingCircuitId: null,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
|
|
@ -98,6 +100,17 @@ export async function updateDistributionBoard(
|
|||
.filter((field) => parsed.data[field] !== undefined)
|
||||
.map((field) => [field, parsed.data[field]])
|
||||
);
|
||||
const feedingPatch = {
|
||||
...(parsed.data.feedingDistributionBoardId === undefined
|
||||
? {}
|
||||
: {
|
||||
feedingDistributionBoardId:
|
||||
parsed.data.feedingDistributionBoardId,
|
||||
}),
|
||||
...(parsed.data.feedingCircuitId === undefined
|
||||
? {}
|
||||
: { feedingCircuitId: parsed.data.feedingCircuitId }),
|
||||
};
|
||||
try {
|
||||
const result = projectCommandService.executeUser({
|
||||
projectId,
|
||||
|
|
@ -110,6 +123,7 @@ export async function updateDistributionBoard(
|
|||
supplyType: parsed.data.supplyType,
|
||||
simultaneityFactor: parsed.data.simultaneityFactor,
|
||||
...infoPatch,
|
||||
...feedingPatch,
|
||||
}
|
||||
),
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue