mirror of
https://github.com/immich-app/immich.git
synced 2025-07-15 20:38:26 +02:00
fix: show/set activity like per user (#4775)
* fix: like per user * chore: open api * chore: e2e test for userId filtering
This commit is contained in:
parent
cf4ec06750
commit
0130591a0f
10 changed files with 89 additions and 17 deletions
server/test/e2e
|
@ -134,6 +134,29 @@ describe(`${ActivityController.name} (e2e)`, () => {
|
|||
expect(body[0]).toEqual(reaction);
|
||||
});
|
||||
|
||||
it('should filter by userId', async () => {
|
||||
const [reaction] = await Promise.all([
|
||||
api.activityApi.create(server, admin.accessToken, { albumId: album.id, type: ReactionType.LIKE }),
|
||||
]);
|
||||
|
||||
const response1 = await request(server)
|
||||
.get('/activity')
|
||||
.query({ albumId: album.id, userId: uuidStub.notFound })
|
||||
.set('Authorization', `Bearer ${admin.accessToken}`);
|
||||
|
||||
expect(response1.status).toEqual(200);
|
||||
expect(response1.body.length).toBe(0);
|
||||
|
||||
const response2 = await request(server)
|
||||
.get('/activity')
|
||||
.query({ albumId: album.id, userId: admin.userId })
|
||||
.set('Authorization', `Bearer ${admin.accessToken}`);
|
||||
|
||||
expect(response2.status).toEqual(200);
|
||||
expect(response2.body.length).toBe(1);
|
||||
expect(response2.body[0]).toEqual(reaction);
|
||||
});
|
||||
|
||||
it('should filter by assetId', async () => {
|
||||
const [reaction] = await Promise.all([
|
||||
api.activityApi.create(server, admin.accessToken, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue