fix(server): add album-shared assets to albums (#32609)

Co-authored-by: Jason Rasmussen <jason@rasm.me>
(cherry picked from commit 37c34343e1b98edf07dc3ff34c5da461de03c746)
This commit is contained in:
Yaros
2026-10-28 20:40:53 +03:00
committed by Codex
parent 8119a5ee22
commit 1f422ea4c4
3 changed files with 76 additions and 11 deletions
+3 -9
View File
@@ -628,25 +628,19 @@ describe('/albums', () => {
]);
});
it('should not be able to remove foreign asset from foreign album', async () => {
it('should be able to remove foreign asset from shared album as an editor', async () => {
const { status, body } = await request(app)
.delete(`/albums/${user1Albums[0].id}/assets`)
.set('Authorization', `Bearer ${user2.accessToken}`)
.send({ ids: [user1Asset1.id] });
expect(status).toBe(200);
expect(body).toEqual([
expect.objectContaining({
id: user1Asset1.id,
success: false,
error: 'no_permission',
}),
]);
expect(body).toEqual([expect.objectContaining({ id: user1Asset1.id, success: true })]);
});
it('should be able to remove own asset from own album', async () => {
const { status, body } = await request(app)
.delete(`/albums/${user1Albums[0].id}/assets`)
.delete(`/albums/${user1Albums[2].id}/assets`)
.set('Authorization', `Bearer ${user1.accessToken}`)
.send({ ids: [user1Asset1.id] });