immich/server/e2e/client/shared-link-api.ts
2024-02-21 17:34:11 -05:00

14 lines
451 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;
},
};