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:
David Mehren 2020-10-24 21:11:06 +02:00
parent 80e4d029f7
commit c0527c0942
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
4 changed files with 1 additions and 94 deletions

View file

@ -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);
}
}