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:
@@ -7,7 +7,7 @@ import { Notes, Users } from '@/models/index.js';
|
||||
* Get note for API processing
|
||||
*/
|
||||
export async function getNote(noteId: Note['id']) {
|
||||
const note = await Notes.findOne(noteId);
|
||||
const note = await Notes.findOneBy({ id: noteId });
|
||||
|
||||
if (note == null) {
|
||||
throw new IdentifiableError('9725d0ce-ba28-4dde-95a7-2cbb2c15de24', 'No such note.');
|
||||
@@ -20,7 +20,7 @@ export async function getNote(noteId: Note['id']) {
|
||||
* Get user for API processing
|
||||
*/
|
||||
export async function getUser(userId: User['id']) {
|
||||
const user = await Users.findOne(userId);
|
||||
const user = await Users.findOneBy({ id: userId });
|
||||
|
||||
if (user == null) {
|
||||
throw new IdentifiableError('15348ddd-432d-49c2-8a5a-8069753becff', 'No such user.');
|
||||
|
||||
Reference in New Issue
Block a user