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:
@@ -18,6 +18,6 @@ export default async (actor: CacheableRemoteUser, activity: IBlock): Promise<str
|
||||
return `skip: ブロックしようとしているユーザーはローカルユーザーではありません`;
|
||||
}
|
||||
|
||||
await block(await Users.findOneOrFail(actor.id), blockee);
|
||||
await block(await Users.findOneByOrFail({ id: actor.id }), blockee);
|
||||
return `ok`;
|
||||
};
|
||||
|
@@ -12,7 +12,7 @@ export async function deleteActor(actor: CacheableRemoteUser, uri: string): Prom
|
||||
return `skip: delete actor ${actor.uri} !== ${uri}`;
|
||||
}
|
||||
|
||||
const user = await Users.findOneOrFail(actor.id);
|
||||
const user = await Users.findOneByOrFail({ id: actor.id });
|
||||
if (user.isDeleted) {
|
||||
logger.info(`skip: already deleted`);
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@ export default async (actor: CacheableRemoteUser, activity: IFlag): Promise<stri
|
||||
const uris = getApIds(activity.object);
|
||||
|
||||
const userIds = uris.filter(uri => uri.startsWith(config.url + '/users/')).map(uri => uri.split('/').pop()!);
|
||||
const users = await Users.find({
|
||||
const users = await Users.findBy({
|
||||
id: In(userIds),
|
||||
});
|
||||
if (users.length < 1) return `skip`;
|
||||
|
@@ -13,7 +13,7 @@ export const performReadActivity = async (actor: CacheableRemoteUser, activity:
|
||||
|
||||
const messageId = id.split('/').pop();
|
||||
|
||||
const message = await MessagingMessages.findOne(messageId);
|
||||
const message = await MessagingMessages.findOneBy({ id: messageId });
|
||||
if (message == null) {
|
||||
return `skip: message not found`;
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ export default async (actor: CacheableRemoteUser, activity: IAccept): Promise<st
|
||||
return `skip: follower not found`;
|
||||
}
|
||||
|
||||
const following = await Followings.findOne({
|
||||
const following = await Followings.findOneBy({
|
||||
followerId: follower.id,
|
||||
followeeId: actor.id,
|
||||
});
|
||||
|
@@ -6,7 +6,7 @@ import deleteNote from '@/services/note/delete.js';
|
||||
export const undoAnnounce = async (actor: CacheableRemoteUser, activity: IAnnounce): Promise<string> => {
|
||||
const uri = getApId(activity);
|
||||
|
||||
const note = await Notes.findOne({
|
||||
const note = await Notes.findOneBy({
|
||||
uri,
|
||||
});
|
||||
|
||||
|
@@ -16,6 +16,6 @@ export default async (actor: CacheableRemoteUser, activity: IBlock): Promise<str
|
||||
return `skip: ブロック解除しようとしているユーザーはローカルユーザーではありません`;
|
||||
}
|
||||
|
||||
await unblock(await Users.findOneOrFail(actor.id), blockee);
|
||||
await unblock(await Users.findOneByOrFail({ id: actor.id }), blockee);
|
||||
return `ok`;
|
||||
};
|
||||
|
@@ -17,12 +17,12 @@ export default async (actor: CacheableRemoteUser, activity: IFollow): Promise<st
|
||||
return `skip: フォロー解除しようとしているユーザーはローカルユーザーではありません`;
|
||||
}
|
||||
|
||||
const req = await FollowRequests.findOne({
|
||||
const req = await FollowRequests.findOneBy({
|
||||
followerId: actor.id,
|
||||
followeeId: followee.id,
|
||||
});
|
||||
|
||||
const following = await Followings.findOne({
|
||||
const following = await Followings.findOneBy({
|
||||
followerId: actor.id,
|
||||
followeeId: followee.id,
|
||||
});
|
||||
|
Reference in New Issue
Block a user