mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-23 18:33:09 +02:00
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
1 changed files with 2 additions and 0 deletions
|
@ -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 a new issue