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:
parent
fd12efddaa
commit
4f0e0f067e
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue