small frontend rewrite

This commit is contained in:
Zoe
2023-04-24 20:12:36 -05:00
parent 4890d657b5
commit 5743ae664e
40 changed files with 2630 additions and 2569 deletions

View File

@@ -3,7 +3,7 @@ import { v4 as uuidv4 } from 'uuid';
import * as dotenv from 'dotenv';
import crypto from 'node:crypto';
import { PrismaClient } from '@prisma/client';
import { IUser, SafeUser } from '~/types';
import { IUser } from '~/types';
const prisma = new PrismaClient();
dotenv.config();
@@ -27,7 +27,25 @@ export default defineEventHandler(async (event) => {
id: true,
username: true,
passwordhash: true,
email: true,
servers: {
select: {
id: true,
name: true,
channels: true,
}
},
channels: {
select: {
id: true,
DM: true,
dmParticipants: {
select: {
id: true,
username: true,
}
}
}
}
},
}) as unknown as IUser;
@@ -51,11 +69,10 @@ export default defineEventHandler(async (event) => {
}
});
user = user as SafeUser;
user.passwordhash = undefined;
return {
token,
userId: user.id,
user
};
});