mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Feat: create user page, add user bio and avatar
This commit is contained in:
@@ -3,6 +3,7 @@ import { z } from 'zod';
|
||||
import { hashPassword } from '../../../config/auth/passwordFns';
|
||||
import DBClient from '../../DBClient';
|
||||
import GetUserSchema from '../../../services/User/schema/GetUserSchema';
|
||||
import imageUrls from '../util/imageUrls';
|
||||
|
||||
const createAdminUser = async () => {
|
||||
const hash = await hashPassword('Pas!3word');
|
||||
@@ -15,6 +16,14 @@ const createAdminUser = async () => {
|
||||
dateOfBirth: new Date('1990-01-01'),
|
||||
role: 'ADMIN',
|
||||
hash,
|
||||
userAvatar: {
|
||||
create: {
|
||||
path: imageUrls[Math.floor(Math.random() * imageUrls.length)],
|
||||
alt: 'Admin User',
|
||||
caption: 'Admin User',
|
||||
createdAt: new Date(),
|
||||
},
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
@@ -27,6 +36,8 @@ const createAdminUser = async () => {
|
||||
accountIsVerified: true,
|
||||
updatedAt: true,
|
||||
role: true,
|
||||
bio: true,
|
||||
userAvatar: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user