refactor: migrate library spec to factories (#16711)

This commit is contained in:
Jason Rasmussen 2025-03-08 13:44:36 -05:00 committed by GitHub
parent fd46d43726
commit 1e127ae3a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 407 additions and 535 deletions

View file

@ -1,6 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
import { ArrayMaxSize, ArrayUnique, IsNotEmpty, IsString } from 'class-validator';
import { LibraryEntity } from 'src/entities/library.entity';
import { Library } from 'src/database';
import { Optional, ValidateUUID } from 'src/validation';
export class CreateLibraryDto {
@ -120,7 +120,7 @@ export class LibraryStatsResponseDto {
usage = 0;
}
export function mapLibrary(entity: LibraryEntity): LibraryResponseDto {
export function mapLibrary(entity: Library): LibraryResponseDto {
let assetCount = 0;
if (entity.assets) {
assetCount = entity.assets.length;