mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
25 lines
836 B
TypeScript
25 lines
836 B
TypeScript
|
|
import { Controller, Get, Query } from '@nestjs/common';
|
||
|
|
import { ApiTags } from '@nestjs/swagger';
|
||
|
|
import { AssetResponseDto } from 'src/dtos/asset-response.dto';
|
||
|
|
import { AuthDto } from 'src/dtos/auth.dto';
|
||
|
|
import { Auth, Authenticated } from 'src/middleware/auth.guard';
|
||
|
|
import { ViewService } from 'src/services/view.service';
|
||
|
|
|
||
|
|
@ApiTags('View')
|
||
|
|
@Controller('view')
|
||
|
|
export class ViewController {
|
||
|
|
constructor(private service: ViewService) {}
|
||
|
|
|
||
|
|
@Get('folder/unique-paths')
|
||
|
|
@Authenticated()
|
||
|
|
getUniqueOriginalPaths(@Auth() auth: AuthDto): Promise<string[]> {
|
||
|
|
return this.service.getUniqueOriginalPaths(auth);
|
||
|
|
}
|
||
|
|
|
||
|
|
@Get('folder')
|
||
|
|
@Authenticated()
|
||
|
|
getAssetsByOriginalPath(@Auth() auth: AuthDto, @Query('path') path: string): Promise<AssetResponseDto[]> {
|
||
|
|
return this.service.getAssetsByOriginalPath(auth, path);
|
||
|
|
}
|
||
|
|
}
|