From 65ff2c24980b7989a2925772721c0b2bc503d515 Mon Sep 17 00:00:00 2001 From: nenohi Date: Wed, 19 Apr 2023 08:25:24 +0900 Subject: カスタム絵文字のライセンスを一括でできるように (#10671) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * setlicensebulk追加 * 5時に誤字った!w * 並び順の変更(set,add,removeの順 * add changelog --- packages/backend/src/core/CustomEmojiService.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'packages/backend/src/core/CustomEmojiService.ts') diff --git a/packages/backend/src/core/CustomEmojiService.ts b/packages/backend/src/core/CustomEmojiService.ts index 4ffa179cab..93557ce617 100644 --- a/packages/backend/src/core/CustomEmojiService.ts +++ b/packages/backend/src/core/CustomEmojiService.ts @@ -197,6 +197,22 @@ export class CustomEmojiService { emojis: await this.emojiEntityService.packDetailedMany(ids), }); } + + @bindThis + public async setLicenseBulk(ids: Emoji['id'][], license: string | null) { + await this.emojisRepository.update({ + id: In(ids), + }, { + updatedAt: new Date(), + license: license, + }); + + this.localEmojisCache.refresh(); + + this.globalEventService.publishBroadcastStream('emojiUpdated', { + emojis: await this.emojiEntityService.packDetailedMany(ids), + }); + } @bindThis public async delete(id: Emoji['id']) { -- cgit v1.2.3-freya