Update update.ts

This commit is contained in:
syuilo 2019-04-09 23:40:55 +09:00
parent 96443384fe
commit 4d64fd665e
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69

View File

@ -177,7 +177,7 @@ export default define(meta, async (ps, user, app) => {
if (avatar == null || avatar.userId !== user.id) throw new ApiError(meta.errors.noSuchAvatar); 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.type.startsWith('image/')) throw new ApiError(meta.errors.avatarNotAnImage);
updates.avatarUrl = avatar.thumbnailUrl; updates.avatarUrl = DriveFiles.getPublicUrl(avatar, true);
if (avatar.properties.avgColor) { if (avatar.properties.avgColor) {
updates.avatarColor = avatar.properties.avgColor; updates.avatarColor = avatar.properties.avgColor;
@ -190,7 +190,7 @@ export default define(meta, async (ps, user, app) => {
if (banner == null || banner.userId !== user.id) throw new ApiError(meta.errors.noSuchBanner); 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.type.startsWith('image/')) throw new ApiError(meta.errors.bannerNotAnImage);
updates.bannerUrl = banner.webpublicUrl; updates.bannerUrl = DriveFiles.getPublicUrl(banner, false);
if (banner.properties.avgColor) { if (banner.properties.avgColor) {
updates.bannerColor = banner.properties.avgColor; updates.bannerColor = banner.properties.avgColor;