(options: SyncQueryOptions, response: Writable, checkpointMap: CheckpointMap)
| 427 | } |
| 428 | |
| 429 | private async syncAlbumsV1(options: SyncQueryOptions, response: Writable, checkpointMap: CheckpointMap) { |
| 430 | const deleteType = SyncEntityType.AlbumDeleteV1; |
| 431 | const deletes = this.syncRepository.album.getDeletes({ ...options, ack: checkpointMap[deleteType] }); |
| 432 | for await (const { id, ...data } of deletes) { |
| 433 | send(response, { type: deleteType, ids: [id], data }); |
| 434 | } |
| 435 | |
| 436 | const upsertType = SyncEntityType.AlbumV1; |
| 437 | const upserts = this.syncRepository.album.getUpserts({ ...options, ack: checkpointMap[upsertType] }); |
| 438 | for await (const { updateId, ...data } of upserts) { |
| 439 | const albumUsers = await this.syncRepository.album.getAlbumUsers(data.id); |
| 440 | send(response, { type: upsertType, ids: [updateId], data: syncAlbumV2ToV1(data, albumUsers) }); |
| 441 | } |
| 442 | } |
| 443 | |
| 444 | private async syncAlbumsV2(options: SyncQueryOptions, response: Writable, checkpointMap: CheckpointMap) { |
| 445 | const deleteType = SyncEntityType.AlbumDeleteV1; |
no test coverage detected