forked from mirrors/misskey
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:
@@ -13,7 +13,7 @@ import { countIf } from '@/prelude/array.js';
|
||||
import * as url from '@/prelude/url.js';
|
||||
import { Users, Notes } from '@/models/index.js';
|
||||
import { makePaginationQuery } from '../api/common/make-pagination-query.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
import { Brackets, IsNull } from 'typeorm';
|
||||
import { Note } from '@/models/entities/note.js';
|
||||
|
||||
export default async (ctx: Router.RouterContext) => {
|
||||
@@ -35,9 +35,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) {
|
||||
@@ -99,7 +99,7 @@ export default async (ctx: Router.RouterContext) => {
|
||||
*/
|
||||
export async function packActivity(note: Note): Promise<any> {
|
||||
if (note.renoteId && note.text == null && !note.hasPoll && (note.fileIds == null || note.fileIds.length === 0)) {
|
||||
const renote = await Notes.findOneOrFail(note.renoteId);
|
||||
const renote = await Notes.findOneByOrFail({ id: note.renoteId });
|
||||
return renderAnnounce(renote.uri ? renote.uri : `${config.url}/notes/${renote.id}`, note);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user