Skip to content
Snippets Groups Projects
Unverified Commit 0ddc79bb authored by Nanashia's avatar Nanashia Committed by GitHub
Browse files

fix(backend): アバターとバナーがリセットできない (#10643)

* fix(backend): avatar and banner couldn't be reset

* Update CHANGELOG.md
parent d2aba9b6
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,7 @@
### Server
- Fix: エクスポートデータの拡張子がunknownになる問題を修正
- Fix: Content-Dispositionのパースでエラーが発生した場合にダウンロードが完了しない問題を修正
- Fix: API: i/update avatarIdとbannerIdにnullを渡した時、画像がリセットされない問題を修正
## 13.11.3
......
......@@ -221,6 +221,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
updates.avatarId = avatar.id;
updates.avatarUrl = this.driveFileEntityService.getPublicUrl(avatar, 'avatar');
updates.avatarBlurhash = avatar.blurhash;
} else if (ps.avatarId === null) {
updates.avatarId = null;
updates.avatarUrl = null;
updates.avatarBlurhash = null;
}
if (ps.bannerId) {
......@@ -232,6 +236,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
updates.bannerId = banner.id;
updates.bannerUrl = this.driveFileEntityService.getPublicUrl(banner);
updates.bannerBlurhash = banner.blurhash;
} else if (ps.bannerId === null) {
updates.bannerId = null;
updates.bannerUrl = null;
updates.bannerBlurhash = null;
}
if (ps.pinnedPageId) {
......
......@@ -508,7 +508,6 @@ describe('ユーザー', () => {
};
assert.deepStrictEqual(response, expected, inspect(parameters));
if (1) return; // BUG 521eb95 以降アバターのリセットができない。
const parameters2 = { avatarId: null };
const response2 = await successfulApiCall({ endpoint: 'i/update', parameters: parameters2, user: alice });
const expected2 = {
......@@ -534,7 +533,6 @@ describe('ユーザー', () => {
};
assert.deepStrictEqual(response, expected, inspect(parameters));
if (1) return; // BUG 521eb95 以降バナーのリセットができない。
const parameters2 = { bannerId: null };
const response2 = await successfulApiCall({ endpoint: 'i/update', parameters: parameters2, user: alice });
const expected2 = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment