Function
createRequestContext
(
req: Request,
config: RequestDataHandlers,
schema: DbSchema,
db: Knex
)
Source from the content-addressed store, hash-verified
| 9 | } |
| 10 | |
| 11 | export async function createRequestContext( |
| 12 | req: Request, |
| 13 | config: RequestDataHandlers, |
| 14 | schema: DbSchema, |
| 15 | db: Knex |
| 16 | ): Promise<SyncRequestContext> { |
| 17 | const userId = await config.getUserId(req); |
| 18 | const lastSyncId = await config.getLastSyncId(req); |
| 19 | |
| 20 | return { |
| 21 | userId, |
| 22 | lastSyncId, |
| 23 | schema, |
| 24 | db, |
| 25 | }; |
| 26 | } |
Tested by
no test coverage detected