refactor: resolve #7139
This commit is contained in:
parent
ebadd7fd3f
commit
91172654e4
76 changed files with 107 additions and 221 deletions
|
|
@ -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, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue