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:
parent
41c87074e6
commit
1c67c26bd8
325 changed files with 1314 additions and 1494 deletions
|
|
@ -2,6 +2,7 @@ import define from '../../define.js';
|
|||
import { ApiError } from '../../error.js';
|
||||
import { Pages, Users } from '@/models/index.js';
|
||||
import { Page } from '@/models/entities/page.js';
|
||||
import { IsNull } from 'typeorm';
|
||||
|
||||
export const meta = {
|
||||
tags: ['pages'],
|
||||
|
|
@ -38,14 +39,14 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||
let page: Page | undefined;
|
||||
|
||||
if (ps.pageId) {
|
||||
page = await Pages.findOne(ps.pageId);
|
||||
page = await Pages.findOneBy({ id: ps.pageId });
|
||||
} else if (ps.name && ps.username) {
|
||||
const author = await Users.findOne({
|
||||
host: null,
|
||||
const author = await Users.findOneBy({
|
||||
host: IsNull(),
|
||||
usernameLower: ps.username.toLowerCase(),
|
||||
});
|
||||
if (author) {
|
||||
page = await Pages.findOne({
|
||||
page = await Pages.findOneBy({
|
||||
name: ps.name,
|
||||
userId: author.id,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue