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
@@ -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)));