1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-04-07 07:09:59 +02:00
pigallery2/src/frontend/app/pipes/FileDTOToRelativePathPipe.ts
2023-09-06 22:24:43 +02:00

18 lines
479 B
TypeScript

import { Pipe, PipeTransform } from '@angular/core';
import { FileDTO } from '../../../common/entities/FileDTO';
import { Utils } from '../../../common/Utils';
@Pipe({ name: 'toRelativePath' })
export class FileDTOToRelativePathPipe implements PipeTransform {
transform(metaFile: FileDTO): string | null {
if (!metaFile) {
return null;
}
return Utils.concatUrls(
metaFile.directory.path,
metaFile.directory.name,
metaFile.name
);
}
}