mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
refactor(server, web): create shared link (#2879)
* refactor: shared links * chore: open api * fix: tsc error
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
import { AlbumResponseDto, AuthService, CreateAlbumDto, SharedLinkResponseDto, UserService } from '@app/domain';
|
||||
import { CreateAlbumShareLinkDto } from '@app/immich/api-v1/album/dto/create-album-shared-link.dto';
|
||||
import {
|
||||
AlbumResponseDto,
|
||||
AuthService,
|
||||
CreateAlbumDto,
|
||||
SharedLinkCreateDto,
|
||||
SharedLinkResponseDto,
|
||||
UserService,
|
||||
} from '@app/domain';
|
||||
import { AppModule } from '@app/immich/app.module';
|
||||
import { AuthUserDto } from '@app/immich/decorators/auth-user.decorator';
|
||||
import { SharedLinkType } from '@app/infra/entities';
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import request from 'supertest';
|
||||
@@ -14,8 +21,10 @@ async function _createAlbum(app: INestApplication, data: CreateAlbumDto) {
|
||||
return res.body as AlbumResponseDto;
|
||||
}
|
||||
|
||||
async function _createAlbumSharedLink(app: INestApplication, data: CreateAlbumShareLinkDto) {
|
||||
const res = await request(app.getHttpServer()).post('/album/create-shared-link').send(data);
|
||||
async function _createAlbumSharedLink(app: INestApplication, data: Omit<SharedLinkCreateDto, 'type'>) {
|
||||
const res = await request(app.getHttpServer())
|
||||
.post('/shared-link')
|
||||
.send({ ...data, type: SharedLinkType.ALBUM });
|
||||
expect(res.status).toEqual(201);
|
||||
return res.body as SharedLinkResponseDto;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user