mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-07 06:40:11 +00:00
Pass user ID to addSyncShelvesJob
Include the requesting user's ID as an additional argument when enqueueing immediate shelf sync jobs so the job has user context. Updated the route implementation and adjusted affected tests (goodreads-shelves-id, hardcover-shelves-id, and hardcover-shelves routes tests) to expect the extra 'user-1' parameter.
This commit is contained in:
@@ -195,6 +195,7 @@ describe('PATCH /api/user/hardcover-shelves/[id]', () => {
|
||||
SHELF.id,
|
||||
'hardcover',
|
||||
0,
|
||||
'user-1',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -216,7 +217,7 @@ describe('PATCH /api/user/hardcover-shelves/[id]', () => {
|
||||
where: { id: 'hc-shelf-1' },
|
||||
data: expect.objectContaining({ listId: 'status-3', lastSyncAt: null }),
|
||||
});
|
||||
expect(jobQueueMock.addSyncShelvesJob).toHaveBeenCalledWith(undefined, updated.id, 'hardcover', 0);
|
||||
expect(jobQueueMock.addSyncShelvesJob).toHaveBeenCalledWith(undefined, updated.id, 'hardcover', 0, 'user-1');
|
||||
});
|
||||
|
||||
it('encrypts the apiToken before persisting', async () => {
|
||||
|
||||
Reference in New Issue
Block a user