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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user