add page id in updated page json file in gcs (#319)
This commit is contained in:
@ -37,9 +37,9 @@ export const createPubSubClient = (): PubsubClient => {
|
||||
Buffer.from(JSON.stringify({ userId, email, name, username }))
|
||||
)
|
||||
},
|
||||
pageSaved: (page: Partial<Page>, userId: string): Promise<void> => {
|
||||
pageUpdated: (page: Partial<Page>, userId: string): Promise<void> => {
|
||||
return publish(
|
||||
'pageSaved',
|
||||
'pageUpdated',
|
||||
Buffer.from(JSON.stringify({ ...page, userId }))
|
||||
)
|
||||
},
|
||||
@ -73,7 +73,7 @@ export interface PubsubClient {
|
||||
username: string
|
||||
) => Promise<void>
|
||||
pageCreated: (page: Page) => Promise<void>
|
||||
pageSaved: (page: Partial<Page>, userId: string) => Promise<void>
|
||||
pageUpdated: (page: Partial<Page>, userId: string) => Promise<void>
|
||||
pageDeleted: (id: string, userId: string) => Promise<void>
|
||||
reportSubmitted(
|
||||
submitterId: string | undefined,
|
||||
|
||||
@ -206,7 +206,7 @@ export const updatePage = async (
|
||||
|
||||
if (body.result !== 'updated') return false
|
||||
|
||||
await ctx.pubsub.pageSaved(page, ctx.uid)
|
||||
await ctx.pubsub.pageUpdated({ ...page, id }, ctx.uid)
|
||||
|
||||
return true
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user