You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mediarepo/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/file-metadata.component.ts

22 lines
612 B
TypeScript

import {Component, Input} from "@angular/core";
import {File} from "../../../../models/File";
import {FileService} from "../../../../services/file/file.service";
@Component({
selector: "app-file-metadata",
templateUrl: "./file-metadata.component.html",
styleUrls: ["./file-metadata.component.scss"]
})
export class FileMetadataComponent {
@Input() file!: File;
constructor(private fileService: FileService) {
}
public async saveFileName(name: string) {
const newFile = await this.fileService.updateFileName(this.file, name);
this.file.name = newFile.name;
}
}