mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 03:27:05 -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
241a577a02
commit
85ee6780ad
4 changed files with 1 additions and 94 deletions
|
@ -73,14 +73,6 @@ export class NotesController {
|
|||
return this.noteService.getNoteMetadata(noteIdOrAlias);
|
||||
}
|
||||
|
||||
@Put(':noteIdOrAlias/metadata')
|
||||
updateNoteMetadata(
|
||||
@Param('noteIdOrAlias') noteIdOrAlias: string,
|
||||
@Body() updateDto: NoteMetadataUpdateDto,
|
||||
) {
|
||||
return this.noteService.updateNoteMetadata(noteIdOrAlias, updateDto);
|
||||
}
|
||||
|
||||
@Put(':noteIdOrAlias/permissions')
|
||||
updateNotePermissions(
|
||||
@Param('noteIdOrAlias') noteIdOrAlias: string,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,6 +76,7 @@ export class RevisionsService {
|
|||
createRevision(content: string) {
|
||||
// TODO: Add previous revision
|
||||
// TODO: Calculate patch
|
||||
// TODO: Save metadata
|
||||
return this.revisionRepository.create({
|
||||
content: content,
|
||||
length: content.length,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue