Procházet zdrojové kódy

query node - council mappings lint fixes II

ondratra před 3 roky
rodič
revize
019bd2022a

+ 2 - 0
.github/workflows/integration-tests.yml

@@ -20,6 +20,7 @@ jobs:
         yarn workspace @joystream/types build
         yarn workspace @joystream/metadata-protobuf build
         yarn workspace integration-tests checks --quiet
+        yarn workspace query-node-root lint
 
   network_build_osx:
     name: MacOS Checks
@@ -39,3 +40,4 @@ jobs:
         yarn workspace @joystream/types build
         yarn workspace @joystream/metadata-protobuf build
         yarn workspace integration-tests checks --quiet
+        yarn workspace query-node-root lint

+ 1 - 1
query-node/mappings/.eslintrc.js

@@ -4,6 +4,6 @@ module.exports = {
   },
   rules: {
     '@typescript-eslint/naming-convention': 'off',
-    '@typescript-eslint/no-explicit-any': 'off'
+    '@typescript-eslint/no-explicit-any': 'off',
   },
 }

+ 3 - 5
query-node/mappings/src/council.ts

@@ -443,11 +443,9 @@ export async function council_NewCouncilElected({ event, store }: EventContext &
   // get election round and its candidates
   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
   const electedCouncil = new ElectedCouncil({

+ 1 - 1
query-node/mappings/src/workingGroups.ts

@@ -482,7 +482,7 @@ export async function workingGroups_OpeningFilled({ store, event }: EventContext
     'applications',
     'applications.applicant',
   ])
-  const acceptedApplicationIds = createType('Vec<ApplicationId>', applicationIdsSet.toHex())
+  const acceptedApplicationIds = createType('Vec<ApplicationId>', applicationIdsSet.toHex() as any)
 
   // Save the event
   const openingFilledEvent = new OpeningFilledEvent({