fix broken build,
This commit is contained in:
@@ -30,10 +30,15 @@ async function listAccessLogs(): Promise<AccessLog[]> {
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: obsoleted getAccessLog, use getAccessLogById instead
|
||||
async function getAccessLog(id: string): Promise<AccessLog | null> {
|
||||
return prisma.accessLog.findUnique({ where: { id } });
|
||||
}
|
||||
|
||||
async function getAccessLogById(id: string): Promise<AccessLog | null> {
|
||||
return prisma.accessLog.findUnique({ where: { id } });
|
||||
}
|
||||
|
||||
async function createAccessLog(userId?: string, message?: string, metadata?: Record<string, any>): Promise<AccessLog> {
|
||||
return prisma.accessLog.create({
|
||||
data: {
|
||||
@@ -44,6 +49,10 @@ async function createAccessLog(userId?: string, message?: string, metadata?: Rec
|
||||
});
|
||||
}
|
||||
|
||||
function helloworld(): string {
|
||||
return 'helloworld';
|
||||
}
|
||||
|
||||
// async function update(id: string, data: UpdateAccessLog): Promise<AccessLog> {
|
||||
// return prisma.accessLog.update({
|
||||
// where: { id },
|
||||
@@ -63,4 +72,7 @@ export {
|
||||
getAccessLog,
|
||||
listAccessLogs,
|
||||
createAccessLog,
|
||||
getAccessLogById,
|
||||
//
|
||||
helloworld,
|
||||
};
|
||||
|
@@ -6,11 +6,14 @@
|
||||
// RULES:
|
||||
// - Follows same pattern as helloworld.service.ts
|
||||
//
|
||||
import type { Event } from '@prisma/client';
|
||||
|
||||
import prisma from '../lib/prisma';
|
||||
|
||||
type CreateEvent = {
|
||||
eventDate: DateTime;
|
||||
eventDate: Date;
|
||||
title: string;
|
||||
joinMembers?: Json[];
|
||||
joinMembers?: JSON[];
|
||||
price: number;
|
||||
currency: string;
|
||||
duration_m: number;
|
||||
@@ -22,9 +25,9 @@ type CreateEvent = {
|
||||
};
|
||||
|
||||
type UpdateEvent = {
|
||||
eventDate?: DateTime;
|
||||
eventDate?: Date;
|
||||
title?: string;
|
||||
joinMembers?: Json[];
|
||||
joinMembers?: JSON[];
|
||||
price?: number;
|
||||
currency?: string;
|
||||
duration_m?: number;
|
||||
@@ -35,9 +38,9 @@ type UpdateEvent = {
|
||||
memberId?: number;
|
||||
};
|
||||
|
||||
// async function listEvents(): Promise<Event[]> {
|
||||
// return prisma.event.findMany();
|
||||
// }
|
||||
async function listEvents(): Promise<Event[]> {
|
||||
return prisma.event.findMany();
|
||||
}
|
||||
|
||||
// async function getEvent(eventId: number) {
|
||||
// return prisma.event.findFirst({ where: { id: eventId } });
|
||||
|
@@ -12,9 +12,9 @@ import type { EventItem } from '@prisma/client';
|
||||
import prisma from '../lib/prisma';
|
||||
|
||||
type CreateEvent = {
|
||||
eventDate: DateTime;
|
||||
eventDate: Date;
|
||||
title: string;
|
||||
joinMembers?: Json[];
|
||||
joinMembers?: JSON[];
|
||||
price: number;
|
||||
currency: string;
|
||||
duration_m: number;
|
||||
@@ -26,9 +26,9 @@ type CreateEvent = {
|
||||
};
|
||||
|
||||
type UpdateEvent = {
|
||||
eventDate?: DateTime;
|
||||
eventDate?: Date;
|
||||
title?: string;
|
||||
joinMembers?: Json[];
|
||||
joinMembers?: JSON[];
|
||||
price?: number;
|
||||
currency?: string;
|
||||
duration_m?: number;
|
||||
|
@@ -11,9 +11,24 @@ import type { OrderItem } from '@prisma/client';
|
||||
import prisma from '../lib/prisma';
|
||||
|
||||
type CreateOrderItem = {
|
||||
orderNumber?: string;
|
||||
// orderNumber?: string;
|
||||
// status?: string;
|
||||
// eventIds?: number[];
|
||||
|
||||
taxes: number;
|
||||
status: string;
|
||||
shipping: number;
|
||||
discount: number;
|
||||
subtotal: number;
|
||||
orderNumber: string;
|
||||
totalAmount: number;
|
||||
totalQuantity: number;
|
||||
history: Record<string, any>;
|
||||
payment: Record<string, any>;
|
||||
customer: Record<string, any>;
|
||||
delivery: Record<string, any>;
|
||||
items: Record<string, any>[];
|
||||
shippingAddress: Record<string, any>;
|
||||
};
|
||||
|
||||
type UpdateOrderItem = {
|
||||
|
@@ -38,7 +38,7 @@ async function getUserItem(userId: string): Promise<UserItem | null> {
|
||||
return prisma.userItem.findFirst({ where: { id: userId } });
|
||||
}
|
||||
|
||||
async function updateUser(userId: string, updateForm: UpdateUser): Promise<User> {
|
||||
async function updateUser(userId: string, updateForm: UpdateUser): Promise<UserItem> {
|
||||
return prisma.userItem.update({
|
||||
where: { id: userId },
|
||||
data: updateForm,
|
||||
@@ -82,7 +82,7 @@ async function changeToUser(userIdToPromote: string, userIdOfApplicant: string)
|
||||
return promoteResult;
|
||||
}
|
||||
|
||||
async function getUserById1(id: string): Promise<UserItem | null> {
|
||||
async function getUserById(id: string): Promise<UserItem | null> {
|
||||
return prisma.userItem.findFirst({ where: { id } });
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user