Browse Source

Forum mappings & test - PollInput update

Leszek Wiesner 3 years ago
parent
commit
fd502ac6f4

+ 1 - 1
query-node/mappings/forum.ts

@@ -316,7 +316,7 @@ export async function forum_ThreadCreated(ctx: EventContext & StoreContext): Pro
           createdAt: eventTime,
           updatedAt: eventTime,
           poll: threadPoll,
-          text: bytesToString(alt.alternative_text),
+          text: bytesToString(alt),
           index,
         })
 

+ 2 - 6
tests/integration-tests/src/fixtures/forum/CreateThreadsFixture.ts

@@ -7,7 +7,7 @@ import { ISubmittableResult } from '@polkadot/types/types/'
 import { ForumThreadWithPostsFieldsFragment, ThreadCreatedEventFieldsFragment } from '../../graphql/generated/queries'
 import { assert } from 'chai'
 import { StandardizedFixture } from '../../Fixture'
-import { CategoryId, PollAlternativeInput, PollInput } from '@joystream/types/forum'
+import { CategoryId, PollInput } from '@joystream/types/forum'
 import { MemberId, ThreadId } from '@joystream/types/common'
 import { CreateInterface } from '@joystream/types'
 import { POST_DEPOSIT, THREAD_DEPOSIT } from '../../consts'
@@ -65,14 +65,10 @@ export class CreateThreadsFixture extends StandardizedFixture {
       return null
     }
 
-    const alternatives: CreateInterface<PollAlternativeInput>[] = pollParams.alternatives.map((a) => ({
-      alternative_text: a,
-    }))
-
     return {
       description: pollParams.description,
       end_time: pollParams.endTime.getTime(),
-      poll_alternatives: alternatives,
+      poll_alternatives: pollParams.alternatives,
     }
   }