mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
fix: shared link create validation (#30762)
This commit is contained in:
parent
b19c4a591e
commit
6a61901e79
3 changed files with 51 additions and 6 deletions
|
|
@ -313,17 +313,17 @@ describe('/shared-links', () => {
|
|||
.send({ type: SharedLinkType.Album });
|
||||
|
||||
expect(status).toBe(400);
|
||||
expect(body).toEqual(expect.objectContaining({ message: 'Invalid albumId' }));
|
||||
expect(body).toEqual(errorDto.validationError([{ path: [], message: 'albumId is required for type ALBUM' }]));
|
||||
});
|
||||
|
||||
it('should require a valid asset id', async () => {
|
||||
const { status, body } = await request(app)
|
||||
.post('/shared-links')
|
||||
.set('Authorization', `Bearer ${user1.accessToken}`)
|
||||
.send({ type: SharedLinkType.Individual, assetId: uuidDto.notFound });
|
||||
.send({ type: SharedLinkType.Individual, assetIds: [uuidDto.notFound] });
|
||||
|
||||
expect(status).toBe(400);
|
||||
expect(body).toEqual(expect.objectContaining({ message: 'Invalid assetIds' }));
|
||||
expect(body).toEqual(expect.objectContaining({ message: 'Not found or no asset.share access' }));
|
||||
});
|
||||
|
||||
it('should create a shared link', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue