1
0

refactor: migrate to typeorm 3.0 (#8443)

* wip

* wip

* wip

* Update following.ts

* wip

* wip

* wip

* Update resolve-user.ts

* maxQueryExecutionTime

* wip

* wip
This commit is contained in:
syuilo
2022-03-26 15:34:00 +09:00
committed by GitHub
parent 41c87074e6
commit 1c67c26bd8
325 changed files with 1314 additions and 1494 deletions
@@ -9,7 +9,7 @@ import renderOrderedCollectionPage from '@/remote/activitypub/renderer/ordered-c
import renderFollowUser from '@/remote/activitypub/renderer/follow-user.js';
import { setResponseType } from '../activitypub.js';
import { Users, Followings, UserProfiles } from '@/models/index.js';
import { LessThan } from 'typeorm';
import { IsNull, LessThan } from 'typeorm';
export default async (ctx: Router.RouterContext) => {
const userId = ctx.params.user;
@@ -27,9 +27,9 @@ export default async (ctx: Router.RouterContext) => {
return;
}
const user = await Users.findOne({
const user = await Users.findOneBy({
id: userId,
host: null,
host: IsNull(),
});
if (user == null) {
@@ -38,7 +38,7 @@ export default async (ctx: Router.RouterContext) => {
}
//#region Check ff visibility
const profile = await UserProfiles.findOneOrFail(user.id);
const profile = await UserProfiles.findOneByOrFail({ userId: user.id });
if (profile.ffVisibility === 'private') {
ctx.status = 403;