({
ctx,
input,
}: InferProcedureOpts<typeof baseProcedure>)
| 21 | export const bumpProcedure = once(() => baseProcedure.mutation(bump)); |
| 22 | |
| 23 | export async function bump({ |
| 24 | ctx, |
| 25 | input, |
| 26 | }: InferProcedureOpts<typeof baseProcedure>) { |
| 27 | const groupId = await ctx.dataAbstraction.hget( |
| 28 | 'page', |
| 29 | input.pageId, |
| 30 | 'group-id', |
| 31 | ); |
| 32 | |
| 33 | await Promise.all([ |
| 34 | _updateStartingPageId({ |
| 35 | userId: ctx.userId, |
| 36 | pageId: input.pageId, |
| 37 | dataAbstraction: ctx.dataAbstraction, |
| 38 | }), |
| 39 | _updateLastParentId({ |
| 40 | userId: ctx.userId, |
| 41 | pageId: input.pageId, |
| 42 | parentPageId: input.parentPageId, |
| 43 | dataAbstraction: ctx.dataAbstraction, |
| 44 | }), |
| 45 | |
| 46 | _updateRecentPageIds({ |
| 47 | userId: ctx.userId, |
| 48 | pageId: input.pageId, |
| 49 | dataAbstraction: ctx.dataAbstraction, |
| 50 | }), |
| 51 | _updateRecentGroupIds({ |
| 52 | userId: ctx.userId, |
| 53 | groupId, |
| 54 | dataAbstraction: ctx.dataAbstraction, |
| 55 | }), |
| 56 | |
| 57 | _updatePageBacklink({ |
| 58 | pageId: input.pageId, |
| 59 | parentPageId: input.parentPageId, |
| 60 | dataAbstraction: ctx.dataAbstraction, |
| 61 | }), |
| 62 | |
| 63 | _updatePageLastActivityDate({ |
| 64 | pageId: input.pageId, |
| 65 | }), |
| 66 | _updateGroupLastActivityDate({ |
| 67 | userId: ctx.userId, |
| 68 | groupId, |
| 69 | }), |
| 70 | ]); |
| 71 | } |
| 72 | |
| 73 | async function _updateStartingPageId(input: { |
| 74 | userId: string; |
nothing calls this directly
no test coverage detected