refactor: resolve #7139

This commit is contained in:
syuilo 2021-02-13 15:33:38 +09:00
parent ebadd7fd3f
commit 91172654e4
76 changed files with 107 additions and 221 deletions

View file

@ -3,7 +3,6 @@ import define from '../../define';
import { ApiError } from '../../error';
import { Users, UserProfiles } from '../../../../models';
import { ID } from '../../../../misc/cafy-id';
import { ensure } from '../../../../prelude/ensure';
import { toPunyNullable } from '../../../../misc/convert-host';
export const meta = {
@ -51,7 +50,7 @@ export default define(meta, async (ps, me) => {
throw new ApiError(meta.errors.noSuchUser);
}
const profile = await UserProfiles.findOne(user.id).then(ensure);
const profile = await UserProfiles.findOneOrFail(user.id);
if (profile.room.furnitures == null) {
await UserProfiles.update(user.id, {