feat(user): Init user module (#6293)
* init user module * add migration * update module with latest utils * pr ready * make interface types interfaces
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { SqlEntityManager } from "@mikro-orm/postgresql"
|
||||
import { User } from "@models"
|
||||
|
||||
export const createUsers = async (
|
||||
manager: SqlEntityManager,
|
||||
userData = [{ id: "1" }]
|
||||
) => {
|
||||
const users: User[] = []
|
||||
|
||||
for (const user of userData) {
|
||||
const usr = manager.create(User, user)
|
||||
users.push(usr)
|
||||
}
|
||||
|
||||
await manager.persistAndFlush(users)
|
||||
}
|
||||
Reference in New Issue
Block a user