#2-protocol #10
1 changed files with 3 additions and 3 deletions
|
@ -253,9 +253,9 @@ export async function synchronizeProtocolDecisonsById(req: Request, res: Respons
|
||||||
*/
|
*/
|
||||||
export async function synchronizeProtocolVotingsById(req: Request, res: Response): Promise<any> {
|
export async function synchronizeProtocolVotingsById(req: Request, res: Response): Promise<any> {
|
||||||
let protocolId = parseInt(req.params.protocolId);
|
let protocolId = parseInt(req.params.protocolId);
|
||||||
let decisions = req.body.decisions as Array<ProtocolVotingViewModel>;
|
let votings = req.body.votings as Array<ProtocolVotingViewModel>;
|
||||||
|
|
||||||
let syncDecision: Array<SynchronizeProtocolVotingCommand> = decisions.map(
|
let syncVoting: Array<SynchronizeProtocolVotingCommand> = votings.map(
|
||||||
(d: ProtocolVotingViewModel): SynchronizeProtocolVotingCommand => ({
|
(d: ProtocolVotingViewModel): SynchronizeProtocolVotingCommand => ({
|
||||||
id: d.id ?? null,
|
id: d.id ?? null,
|
||||||
topic: d.topic,
|
topic: d.topic,
|
||||||
|
@ -266,7 +266,7 @@ export async function synchronizeProtocolVotingsById(req: Request, res: Response
|
||||||
protocolId,
|
protocolId,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
await ProtocolVotingCommandHandler.sync(syncDecision);
|
await ProtocolVotingCommandHandler.sync(syncVoting);
|
||||||
|
|
||||||
res.sendStatus(204);
|
res.sendStatus(204);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue