From 84386e93a21dc1d45adbb4e2ec826259385dfd1c Mon Sep 17 00:00:00 2001 From: gitwoz <177856586+gitwoz@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:27:58 +0800 Subject: [PATCH] feat(ipns): revise `refreshIPNSFeed` mutation --- src/mutations/user/refreshIPNSFeed.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/mutations/user/refreshIPNSFeed.ts b/src/mutations/user/refreshIPNSFeed.ts index 775cc756f..e6da26b5e 100644 --- a/src/mutations/user/refreshIPNSFeed.ts +++ b/src/mutations/user/refreshIPNSFeed.ts @@ -1,19 +1,20 @@ import type { GQLMutationResolvers } from 'definitions' +import { QUEUE_URL } from 'common/enums' +import { aws } from 'connectors' + const resolver: GQLMutationResolvers['refreshIPNSFeed'] = async ( _, { input: { userName, numArticles = 50 } }, - { - dataSources: { - userService, - queues: { publicationQueue }, - }, - } + { dataSources: { userService } } ) => { const ipnsKeyRec = await userService.findOrCreateIPNSKey(userName) if (ipnsKeyRec) { - // TODO + aws.sqsSendMessage({ + messageBody: { userName, useMattersIPNS: true }, + queueUrl: QUEUE_URL.ipnsUserPublication, + }) } return userService.findByUserName(userName)