mirror of
https://github.com/immich-app/immich.git
synced 2025-11-26 16:25:20 -05:00
fix(server): broken memories (#23896)
This commit is contained in:
parent
074fdb2b96
commit
f11bfb9581
@ -24,6 +24,11 @@ describe(MemoryController.name, () => {
|
|||||||
await request(ctx.getHttpServer()).get('/memories');
|
await request(ctx.getHttpServer()).get('/memories');
|
||||||
expect(ctx.authenticate).toHaveBeenCalled();
|
expect(ctx.authenticate).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should not require any parameters', async () => {
|
||||||
|
await request(ctx.getHttpServer()).get('/memories').query({});
|
||||||
|
expect(service.search).toHaveBeenCalled();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('POST /memories', () => {
|
describe('POST /memories', () => {
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { Memory } from 'src/database';
|
|||||||
import { AssetResponseDto, mapAsset } from 'src/dtos/asset-response.dto';
|
import { AssetResponseDto, mapAsset } from 'src/dtos/asset-response.dto';
|
||||||
import { AuthDto } from 'src/dtos/auth.dto';
|
import { AuthDto } from 'src/dtos/auth.dto';
|
||||||
import { AssetOrderWithRandom, MemoryType } from 'src/enum';
|
import { AssetOrderWithRandom, MemoryType } from 'src/enum';
|
||||||
import { ValidateBoolean, ValidateDate, ValidateEnum, ValidateUUID } from 'src/validation';
|
import { Optional, ValidateBoolean, ValidateDate, ValidateEnum, ValidateUUID } from 'src/validation';
|
||||||
|
|
||||||
class MemoryBaseDto {
|
class MemoryBaseDto {
|
||||||
@ValidateBoolean({ optional: true })
|
@ValidateBoolean({ optional: true })
|
||||||
@ -31,6 +31,7 @@ export class MemorySearchDto {
|
|||||||
@IsInt()
|
@IsInt()
|
||||||
@IsPositive()
|
@IsPositive()
|
||||||
@Type(() => Number)
|
@Type(() => Number)
|
||||||
|
@Optional()
|
||||||
@ApiProperty({ type: 'integer', description: 'Number of memories to return' })
|
@ApiProperty({ type: 'integer', description: 'Number of memories to return' })
|
||||||
size?: number;
|
size?: number;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user