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:
@@ -5,13 +5,14 @@ import renderOrderedCollection from '@/remote/activitypub/renderer/ordered-colle
|
||||
import { setResponseType } from '../activitypub.js';
|
||||
import renderNote from '@/remote/activitypub/renderer/note.js';
|
||||
import { Users, Notes, UserNotePinings } from '@/models/index.js';
|
||||
import { IsNull } from 'typeorm';
|
||||
|
||||
export default async (ctx: Router.RouterContext) => {
|
||||
const userId = ctx.params.user;
|
||||
|
||||
const user = await Users.findOne({
|
||||
const user = await Users.findOneBy({
|
||||
id: userId,
|
||||
host: null,
|
||||
host: IsNull(),
|
||||
});
|
||||
|
||||
if (user == null) {
|
||||
@@ -25,7 +26,7 @@ export default async (ctx: Router.RouterContext) => {
|
||||
});
|
||||
|
||||
const pinnedNotes = await Promise.all(pinings.map(pining =>
|
||||
Notes.findOneOrFail(pining.noteId)));
|
||||
Notes.findOneByOrFail({ id: pining.noteId })));
|
||||
|
||||
const renderedNotes = await Promise.all(pinnedNotes.map(note => renderNote(note)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user