From 408d54f2eb22aecfc64c066c78149d48ca51c2e6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 3 Apr 2022 13:54:22 +0900 Subject: [PATCH] fix(api): admin/update-meta was not working --- CHANGELOG.md | 11 ++++++++--- .../src/server/api/endpoints/admin/update-meta.ts | 4 +++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18f8ede2ed..e1240b6368 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,15 @@ You should also include the user name that made the change. --> -## 12.109.1 (2022/04/02) +## 12.x.x (unreleased) -### Known issues -- two-factor authentication is not working +### Improvements +- + +### Bugfixes +- API: admin/update-meta was not working + +## 12.109.1 (2022/04/02) ### Bugfixes - API: Renoteが行えない問題を修正 diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index 3c39bf0f30..b23ee9e3df 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -397,12 +397,14 @@ export default define(meta, paramDef, async (ps, me) => { } await db.transaction(async transactionalEntityManager => { - const meta = await transactionalEntityManager.findOne(Meta, { + const metas = await transactionalEntityManager.find(Meta, { order: { id: 'DESC', }, }); + const meta = metas[0]; + if (meta) { await transactionalEntityManager.update(Meta, meta.id, set); } else {