mirror of
https://github.com/immich-app/immich.git
synced 2025-05-30 19:55:43 -04:00
* fix(server): stacked assets for full sync, userIds as array for delta sync * refactor(server): sync * fix getDeltaSync after partner removal --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
27 lines
1005 B
TypeScript
27 lines
1005 B
TypeScript
import { Body, Controller, HttpCode, HttpStatus, Post } from '@nestjs/common';
|
|
import { ApiTags } from '@nestjs/swagger';
|
|
import { AssetResponseDto } from 'src/dtos/asset-response.dto';
|
|
import { AuthDto } from 'src/dtos/auth.dto';
|
|
import { AssetDeltaSyncDto, AssetDeltaSyncResponseDto, AssetFullSyncDto } from 'src/dtos/sync.dto';
|
|
import { Auth, Authenticated } from 'src/middleware/auth.guard';
|
|
import { SyncService } from 'src/services/sync.service';
|
|
|
|
@ApiTags('Sync')
|
|
@Controller('sync')
|
|
@Authenticated()
|
|
export class SyncController {
|
|
constructor(private service: SyncService) {}
|
|
|
|
@Post('full-sync')
|
|
@HttpCode(HttpStatus.OK)
|
|
getFullSyncForUser(@Auth() auth: AuthDto, @Body() dto: AssetFullSyncDto): Promise<AssetResponseDto[]> {
|
|
return this.service.getFullSync(auth, dto);
|
|
}
|
|
|
|
@Post('delta-sync')
|
|
@HttpCode(HttpStatus.OK)
|
|
getDeltaSync(@Auth() auth: AuthDto, @Body() dto: AssetDeltaSyncDto): Promise<AssetDeltaSyncResponseDto> {
|
|
return this.service.getDeltaSync(auth, dto);
|
|
}
|
|
}
|