|
@@ -443,11 +443,9 @@ export async function council_NewCouncilElected({ event, store }: EventContext &
|
|
// get election round and its candidates
|
|
// get election round and its candidates
|
|
const electionRound = await getCurrentElectionRound(store)
|
|
const electionRound = await getCurrentElectionRound(store)
|
|
|
|
|
|
- // TODO: uncomment when following query will be working (after some QN patches make it to Olympia)
|
|
|
|
- // const electedCandidates = await store.getMany(Candidate, { where: { electionRoundId: electionRound.id, member: { id_in: electedMemberIds } } })
|
|
|
|
- const electedCandidates = (
|
|
|
|
- await store.getMany(Candidate, { where: { electionRoundId: electionRound.id }, relations: ['member'] })
|
|
|
|
- ).filter((item: Candidate) => electedMemberIds.find((tmpId) => tmpId === item.member.id.toString()))
|
|
|
|
|
|
+ const electedCandidates = await store.getMany(Candidate, {
|
|
|
|
+ where: { electionRoundId: electionRound.id, member: { id_in: electedMemberIds }, relations: ['member'] },
|
|
|
|
+ })
|
|
|
|
|
|
// create new council record
|
|
// create new council record
|
|
const electedCouncil = new ElectedCouncil({
|
|
const electedCouncil = new ElectedCouncil({
|