refresh index after archiving page

This commit is contained in:
Hongbo Wu 2023-06-13 12:44:32 +08:00
parent 771114b30d
commit d851a705a6

View file

@ -1,5 +1,6 @@
import { createOrUpdateLinkShareInfo } from '../../datalayer/links/share_info'
import { updatePage } from '../../elastic/pages'
import { env } from '../../env'
import {
ArchiveLinkError,
ArchiveLinkErrorCode,
@ -10,11 +11,8 @@ import {
UpdateLinkShareInfoErrorCode,
UpdateLinkShareInfoSuccess,
} from '../../generated/graphql'
import { authorized } from '../../utils/helpers'
import { analytics } from '../../utils/analytics'
import { env } from '../../env'
import { updatePage } from '../../elastic/pages'
import { authorized } from '../../utils/helpers'
export const updateLinkShareInfoResolver = authorized<
UpdateLinkShareInfoSuccess,
@ -81,7 +79,7 @@ export const setLinkArchivedResolver = authorized<
{
archivedAt: args.input.archived ? new Date() : null,
},
{ pubsub, uid: claims.uid }
{ pubsub, uid: claims.uid, refresh: true } // refresh index to update search results
)
} catch (e) {
return {