server: fix instance actor creation

Because findBy returns an array which is always truthy, this would
mean the user is not actually created as requested and instead an
empty array is returned.
This commit is contained in:
Johann150 2023-06-29 21:21:26 +02:00
parent 2d46cf7c1e
commit 2f30af1812
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -12,7 +12,7 @@ import { db } from '@/db/postgre.js';
import generateNativeUserToken from '@/server/api/common/generate-native-user-token.js';
export async function getSystemUser(username: string): Promise<User> {
const exist = await Users.findBy({
const exist = await Users.findOneBy({
usernameLower: username.toLowerCase(),
host: IsNull(),
});