( context: SyncRequestContext )
| 25 | | EntityCreateRequest; |
| 26 | |
| 27 | export async function fetchSyncDelta( |
| 28 | context: SyncRequestContext |
| 29 | ): Promise<EntityDelta[]> { |
| 30 | const { db, schema, lastSyncId } = context; |
| 31 | |
| 32 | const syncRequests = await db |
| 33 | .table("sync") |
| 34 | .select("*") |
| 35 | .where("id", ">", lastSyncId) |
| 36 | .andWhere("user_id", "=", context.userId); |
| 37 | |
| 38 | return syncRequests; |
| 39 | } |