mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 14:44:43 -04:00
Remove PUT /notes/{note}/metadata
and corresponding service code
Signed-off-by: David Mehren <git@herrmehren.de> Co-authored-by: Yannick Bungers <git@innay.de>
This commit is contained in:
parent
80e4d029f7
commit
c0527c0942
4 changed files with 1 additions and 94 deletions
|
@ -220,23 +220,4 @@ export class NotesService {
|
|||
editedByAtPosition: [],
|
||||
};
|
||||
}
|
||||
|
||||
async updateNoteMetadata(
|
||||
noteIdOrAlias: string,
|
||||
updateDto: NoteMetadataUpdateDto,
|
||||
) {
|
||||
const note = await this.getNoteByIdOrAlias(noteIdOrAlias);
|
||||
note.title = updateDto.title;
|
||||
note.description = updateDto.description;
|
||||
note.tags = await Promise.all(
|
||||
updateDto.tags.map(async tag => {
|
||||
let dbTag = await this.tagRepository.findOne({ where: { name: tag } });
|
||||
if (!dbTag) {
|
||||
dbTag = await this.tagRepository.create({ name: tag });
|
||||
}
|
||||
return dbTag;
|
||||
}),
|
||||
);
|
||||
await this.noteRepository.save(note);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue