From fafe980315bdc6e4cdf956951adbf2f5d077dd71 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:16:50 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=82=BB=E3=83=B3=E3=82=B7=E3=83=86?= =?UTF-8?q?=E3=82=A3=E3=83=96=E3=81=AA=E7=94=BB=E5=83=8F=E3=82=92=E3=82=A2?= =?UTF-8?q?=E3=82=A4=E3=82=B3=E3=83=B3=E3=83=BB=E3=83=90=E3=83=8A=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E6=8C=87=E5=AE=9A=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/src/server/api/endpoints/i/update.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index 84a1931a3d..2800720fba 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -74,6 +74,18 @@ export const meta = { id: '75aedb19-2afd-4e6d-87fc-67941256fa60', }, + avatarIsSensitive: { + message: 'The file specified as an avatar is marked as sensitive.', + code: 'AVATAR_IS_SENSITIVE', + id: '71bb5e53-4742-4609-b465-36081e131208', + }, + + bannerIsSensitive: { + message: 'The file specified as a banner is marked as sensitive.', + code: 'BANNER_IS_SENSITIVE', + id: 'e148b34c-9f33-4300-93e0-7817008fb366', + }, + noSuchPage: { message: 'No such page.', code: 'NO_SUCH_PAGE', @@ -326,6 +338,7 @@ export default class extends Endpoint { // eslint- if (avatar == null || avatar.userId !== user.id) throw new ApiError(meta.errors.noSuchAvatar); if (!avatar.type.startsWith('image/')) throw new ApiError(meta.errors.avatarNotAnImage); + if (avatar.isSensitive) throw new ApiError(meta.errors.avatarIsSensitive); updates.avatarId = avatar.id; updates.avatarUrl = this.driveFileEntityService.getPublicUrl(avatar, 'avatar'); @@ -341,6 +354,7 @@ export default class extends Endpoint { // eslint- if (banner == null || banner.userId !== user.id) throw new ApiError(meta.errors.noSuchBanner); if (!banner.type.startsWith('image/')) throw new ApiError(meta.errors.bannerNotAnImage); + if (banner.isSensitive) throw new ApiError(meta.errors.bannerIsSensitive); updates.bannerId = banner.id; updates.bannerUrl = this.driveFileEntityService.getPublicUrl(banner);