upd: set file user to system when adding emoji

Prevents cluttering of user's drive and fits the custom emoji import which sets the user as system
This commit is contained in:
Mar0xy 2023-11-12 14:00:35 +01:00
parent fd12efddaa
commit 4f0e0f067e
No known key found for this signature in database
GPG Key ID: 56569BBE47D2C828
1 changed files with 2 additions and 0 deletions

View File

@ -72,6 +72,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const isDuplicate = await this.customEmojiService.checkDuplicate(ps.name);
if (isDuplicate) throw new ApiError(meta.errors.duplicateName);
if (driveFile.user !== null) await this.driveFilesRepository.update(driveFile.id, { user: null });
const emoji = await this.customEmojiService.add({
driveFile,
name: ps.name,