fix username spelling from userName

Signed-off-by: Yannick Bungers <git@innay.de>
This commit is contained in:
Yannick Bungers 2021-10-13 22:28:10 +02:00 committed by David Mehren
parent be27686610
commit 40103cb397
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
23 changed files with 89 additions and 91 deletions

View file

@ -100,7 +100,7 @@ export class MediaController {
// TODO: Move getting the Note object into a decorator
const note: Note = await this.noteService.getNoteByIdOrAlias(noteId);
this.logger.debug(
`Recieved filename '${file.originalname}' for note '${noteId}' from user '${user.userName}'`,
`Recieved filename '${file.originalname}' for note '${noteId}' from user '${user.username}'`,
'uploadMedia',
);
const url = await this.mediaService.saveFile(file.buffer, user, note);
@ -127,7 +127,7 @@ export class MediaController {
@RequestUser() user: User,
@Param('filename') filename: string,
): Promise<void> {
const username = user.userName;
const username = user.username;
try {
this.logger.debug(
`Deleting '${filename}' for user '${username}'`,
@ -136,7 +136,7 @@ export class MediaController {
const mediaUpload = await this.mediaService.findUploadByFilename(
filename,
);
if (mediaUpload.user.userName !== username) {
if (mediaUpload.user.username !== username) {
this.logger.warn(
`${username} tried to delete '${filename}', but is not the owner`,
'deleteMedia',