mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-04-06 07:00:24 +00:00
fix: change logging from id to publicId in media upload
Signed-off-by: Yannick Bungers <git@innay.de>
This commit is contained in:
parent
c20e20b30a
commit
dad60a25ea
2 changed files with 8 additions and 15 deletions
|
@ -88,12 +88,12 @@ export class MediaController {
|
|||
}
|
||||
if (user) {
|
||||
this.logger.debug(
|
||||
`Received filename '${file.originalname}' for note '${note.id}' from user '${user.username}'`,
|
||||
`Received filename '${file.originalname}' for note '${note.publicId}' from user '${user.username}'`,
|
||||
'uploadMedia',
|
||||
);
|
||||
} else {
|
||||
this.logger.debug(
|
||||
`Received filename '${file.originalname}' for note '${note.id}' from not logged in user`,
|
||||
`Received filename '${file.originalname}' for note '${note.publicId}' from not logged in user`,
|
||||
'uploadMedia',
|
||||
);
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ export class MediaController {
|
|||
const mediaUploadNote = await mediaUpload.note;
|
||||
throw new PermissionError(
|
||||
`Neither file '${filename}' nor note '${
|
||||
mediaUploadNote?.id ?? 'unknown'
|
||||
mediaUploadNote?.publicId ?? 'unknown'
|
||||
}'is owned by '${user.username}'`,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -93,17 +93,10 @@ export class MediaController {
|
|||
if (file === undefined) {
|
||||
throw new BadRequestException('Request does not contain a file');
|
||||
}
|
||||
if (user) {
|
||||
this.logger.debug(
|
||||
`Received filename '${file.originalname}' for note '${note.publicId}' from user '${user.username}'`,
|
||||
'uploadMedia',
|
||||
);
|
||||
} else {
|
||||
this.logger.debug(
|
||||
`Received filename '${file.originalname}' for note '${note.publicId}' from not logged in user`,
|
||||
'uploadMedia',
|
||||
);
|
||||
}
|
||||
this.logger.debug(
|
||||
`Received filename '${file.originalname}' for note '${note.publicId}' from user '${user.username}'`,
|
||||
'uploadMedia',
|
||||
);
|
||||
const upload = await this.mediaService.saveFile(file.buffer, user, note);
|
||||
return await this.mediaService.toMediaUploadDto(upload);
|
||||
}
|
||||
|
@ -134,7 +127,7 @@ export class MediaController {
|
|||
const mediaUploadNote = await mediaUpload.note;
|
||||
throw new PermissionError(
|
||||
`Neither file '${filename}' nor note '${
|
||||
mediaUploadNote?.id ?? 'unknown'
|
||||
mediaUploadNote?.publicId ?? 'unknown'
|
||||
}'is owned by '${user.username}'`,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue