mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(api): 🎨 Move createLocalUser to a static method of User
This commit is contained in:
parent
9d70778abd
commit
9e9998ea82
7 changed files with 79 additions and 99 deletions
|
|
@ -1,12 +1,11 @@
|
|||
import { randomBytes } from "node:crypto";
|
||||
import { asc, inArray, like } from "drizzle-orm";
|
||||
import type { Status } from "~database/entities/Status";
|
||||
import { createNewLocalUser } from "~database/entities/User";
|
||||
import { db } from "~drizzle/db";
|
||||
import { Notes, Tokens, Users } from "~drizzle/schema";
|
||||
import { server } from "~index";
|
||||
import { Note } from "~packages/database-interface/note";
|
||||
import type { User } from "~packages/database-interface/user";
|
||||
import { User } from "~packages/database-interface/user";
|
||||
/**
|
||||
* This allows us to send a test request to the server even when it isnt running
|
||||
* CURRENTLY NOT WORKING, NEEDS TO BE FIXED
|
||||
|
|
@ -33,7 +32,7 @@ export const getTestUsers = async (count: number) => {
|
|||
for (let i = 0; i < count; i++) {
|
||||
const password = randomBytes(32).toString("hex");
|
||||
|
||||
const user = await createNewLocalUser({
|
||||
const user = await User.fromDataLocal({
|
||||
username: `test-${randomBytes(32).toString("hex")}`,
|
||||
email: `${randomBytes(32).toString("hex")}@test.com`,
|
||||
password,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue