refactor: library e2e (#7538)

* refactor: library e2e

* refactor: remove before each usages
This commit is contained in:
Jason Rasmussen
2024-02-29 15:10:08 -05:00
committed by GitHub
parent efa6efd200
commit 3d25d91e77
9 changed files with 489 additions and 487 deletions

View File

@@ -10,7 +10,7 @@ import {
ValidateLibraryDto,
ValidateLibraryResponseDto,
} from '@app/domain';
import { Body, Controller, Delete, Get, HttpCode, Param, Post, Put, Query } from '@nestjs/common';
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { AdminRoute, Auth, Authenticated } from '../app.guard';
import { UseValidation } from '../app.utils';
@@ -55,6 +55,7 @@ export class LibraryController {
}
@Delete(':id')
@HttpCode(HttpStatus.NO_CONTENT)
deleteLibrary(@Auth() auth: AuthDto, @Param() { id }: UUIDParamDto): Promise<void> {
return this.service.delete(auth, id);
}
@@ -65,11 +66,13 @@ export class LibraryController {
}
@Post(':id/scan')
@HttpCode(HttpStatus.NO_CONTENT)
scanLibrary(@Auth() auth: AuthDto, @Param() { id }: UUIDParamDto, @Body() dto: ScanLibraryDto) {
return this.service.queueScan(auth, id, dto);
}
@Post(':id/removeOffline')
@HttpCode(HttpStatus.NO_CONTENT)
removeOfflineFiles(@Auth() auth: AuthDto, @Param() { id }: UUIDParamDto) {
return this.service.queueRemoveOffline(auth, id);
}