1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-23 02:06:15 +02:00
immich/server/e2e/client/shared-link-api.ts
2024-01-24 17:24:53 -05:00

21 lines
677 B
TypeScript

import { SharedLinkCreateDto, SharedLinkResponseDto } from '@app/domain';
import request from 'supertest';
export const sharedLinkApi = {
create: async (server: any, accessToken: string, dto: SharedLinkCreateDto) => {
const { status, body } = await request(server)
.post('/shared-link')
.set('Authorization', `Bearer ${accessToken}`)
.send(dto);
expect(status).toBe(201);
return body as SharedLinkResponseDto;
},
getMySharedLink: async (server: any, key: string) => {
const { status, body } = await request(server).get('/shared-link/me').query({ key });
expect(status).toBe(200);
return body as SharedLinkResponseDto;
},
};