Compare commits
7 Commits
develop/re
...
develop/mo
Author | SHA1 | Date | |
---|---|---|---|
![]() |
66272b483c | ||
![]() |
542691f4fd | ||
![]() |
5651150c9d | ||
![]() |
7d634bd15a | ||
![]() |
d685020488 | ||
![]() |
51204af289 | ||
![]() |
2336ade05c |
@@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
tags: frontend, side-menu
|
|
||||||
---
|
|
||||||
|
|
||||||
# REQ0181 frontend side menu configuration
|
|
||||||
|
|
||||||
## sources
|
|
||||||
|
|
||||||
`src/layouts/nav-config-dashboard.tsx`
|
|
@@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
tags: frontend, product, details
|
|
||||||
---
|
|
||||||
|
|
||||||
# REQ0182 frontend product details
|
|
||||||
|
|
||||||
frontend page to display product details
|
|
||||||
|
|
||||||
## sources
|
|
||||||
|
|
||||||
T.B.A.
|
|
@@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
tags: frontend, product, new
|
|
||||||
---
|
|
||||||
|
|
||||||
# REQ0182 frontend product new
|
|
||||||
|
|
||||||
frontend page to create new product
|
|
||||||
|
|
||||||
## sources
|
|
||||||
|
|
||||||
T.B.A.
|
|
@@ -158,5 +158,3 @@
|
|||||||
- [REQ0169: DemoStorageExample](./REQ0169/index.md)
|
- [REQ0169: DemoStorageExample](./REQ0169/index.md)
|
||||||
- [REQ0170: DemoWeatherAppUi](./REQ0170/index.md)
|
- [REQ0170: DemoWeatherAppUi](./REQ0170/index.md)
|
||||||
- [REQ0180: REQ0180 service port schedule](./REQ0180/index.md)
|
- [REQ0180: REQ0180 service port schedule](./REQ0180/index.md)
|
||||||
- [REQ0181: REQ0181 frontend side menu configuration](./REQ0181/index.md)
|
|
||||||
- [REQ0182: REQ0182 frontend product details](./REQ0182/index.md)
|
|
||||||
|
@@ -43,7 +43,6 @@
|
|||||||
"@next-auth/prisma-adapter": "^1.0.7",
|
"@next-auth/prisma-adapter": "^1.0.7",
|
||||||
"@prisma/adapter-pg": "^6.8.2",
|
"@prisma/adapter-pg": "^6.8.2",
|
||||||
"@prisma/client": "^5.6.0",
|
"@prisma/client": "^5.6.0",
|
||||||
"@types/bcrypt": "^5.0.2",
|
|
||||||
"bcrypt": "^5.1.1",
|
"bcrypt": "^5.1.1",
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
|
@@ -1144,7 +1144,6 @@ model EventReview {
|
|||||||
eventItemId String?
|
eventItemId String?
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: need to consider with Event
|
|
||||||
// mapped to IEventItem
|
// mapped to IEventItem
|
||||||
model EventItem {
|
model EventItem {
|
||||||
id String @id @default(uuid())
|
id String @id @default(uuid())
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
yarn db:push
|
|
||||||
|
|
||||||
npx nodemon --ext ts,tsx --exec "yarn tsc"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# yarn build
|
|
||||||
|
|
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
npm run start
|
|
@@ -10,8 +10,7 @@ import type { NextRequest } from 'next/server';
|
|||||||
|
|
||||||
import { STATUS, response, handleError } from 'src/utils/response';
|
import { STATUS, response, handleError } from 'src/utils/response';
|
||||||
|
|
||||||
// import { AccessLogService } from '../../../../modules/AccessLog/AccessLog.service';
|
import { AccessLogService } from '../../../../modules/AccessLog/AccessLog.service';
|
||||||
import { getAccessLogById } from 'src/app/services/AccessLog.service';
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -28,7 +27,7 @@ export async function GET(req: NextRequest) {
|
|||||||
const accessLogId = searchParams.get('accessLogId');
|
const accessLogId = searchParams.get('accessLogId');
|
||||||
if (!accessLogId) return response({ message: 'accessLogId is required!' }, STATUS.BAD_REQUEST);
|
if (!accessLogId) return response({ message: 'accessLogId is required!' }, STATUS.BAD_REQUEST);
|
||||||
|
|
||||||
const accessLog = await getAccessLogById(accessLogId);
|
const accessLog = await AccessLogService.findById(accessLogId);
|
||||||
|
|
||||||
if (!accessLog) return response({ message: 'AccessLog not found!' }, STATUS.NOT_FOUND);
|
if (!accessLog) return response({ message: 'AccessLog not found!' }, STATUS.NOT_FOUND);
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@ import type { NextRequest, NextResponse } from 'next/server';
|
|||||||
|
|
||||||
import { STATUS, response, handleError } from 'src/utils/response';
|
import { STATUS, response, handleError } from 'src/utils/response';
|
||||||
|
|
||||||
import { listAppLogs, deleteAppLog, createNewAppLog } from 'src/app/services/AppLog.service';
|
import { listAppLogs, deleteAppLog, updateAppLog, createNewAppLog } from 'src/app/services/AppLog.service';
|
||||||
|
|
||||||
// import prisma from '../../lib/prisma';
|
// import prisma from '../../lib/prisma';
|
||||||
|
|
||||||
@@ -34,29 +34,28 @@ export async function POST(req: NextRequest) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: delete `update AppLog`
|
/**
|
||||||
// /**
|
***************************************
|
||||||
// ***************************************
|
* PUT - update AppLog
|
||||||
// * PUT - update AppLog
|
***************************************
|
||||||
// ***************************************
|
*/
|
||||||
// */
|
export async function PUT(req: NextRequest) {
|
||||||
// export async function PUT(req: NextRequest) {
|
const { searchParams } = req.nextUrl;
|
||||||
// const { searchParams } = req.nextUrl;
|
const appLogId = searchParams.get('appLogId');
|
||||||
// const appLogId = searchParams.get('appLogId');
|
|
||||||
|
|
||||||
// const { data } = await req.json();
|
const { data } = await req.json();
|
||||||
|
|
||||||
// try {
|
try {
|
||||||
// if (!appLogId) throw new Error('appLogId cannot null');
|
if (!appLogId) throw new Error('appLogId cannot null');
|
||||||
// const id: number = parseInt(appLogId);
|
const id: number = parseInt(appLogId);
|
||||||
|
|
||||||
// const updateResult = await updateAppLog(id, data);
|
const updateResult = await updateAppLog(id, data);
|
||||||
|
|
||||||
// return response(updateResult, STATUS.OK);
|
return response(updateResult, STATUS.OK);
|
||||||
// } catch (error) {
|
} catch (error) {
|
||||||
// return handleError('AppLog - Update', error);
|
return handleError('AppLog - Update', error);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
***************************************
|
***************************************
|
||||||
@@ -73,7 +72,7 @@ export async function DELETE(req: NextRequest) {
|
|||||||
if (!appLogId) throw new Error('appLogId cannot null');
|
if (!appLogId) throw new Error('appLogId cannot null');
|
||||||
const id: number = parseInt(appLogId);
|
const id: number = parseInt(appLogId);
|
||||||
|
|
||||||
const deleteResult = await deleteAppLog(id.toString());
|
const deleteResult = await deleteAppLog(id);
|
||||||
|
|
||||||
return response(deleteResult, STATUS.OK);
|
return response(deleteResult, STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@@ -7,28 +7,29 @@ import { _events } from 'src/_mock/_event';
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
// export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
|
||||||
/** **************************************
|
/** **************************************
|
||||||
* GET - Search events
|
* GET - Search events
|
||||||
*************************************** */
|
*************************************** */
|
||||||
export async function GET(req: NextRequest) {
|
export async function GET(req: NextRequest) {
|
||||||
// try {
|
try {
|
||||||
//
|
const { searchParams } = req.nextUrl;
|
||||||
// TODO: implement search events
|
const query = searchParams.get('query')?.trim().toLowerCase();
|
||||||
//
|
|
||||||
// const { searchParams } = req.nextUrl;
|
|
||||||
// const query = searchParams.get('query')?.trim().toLowerCase();
|
|
||||||
// if (!query) {
|
|
||||||
// return response({ results: [] }, STATUS.OK);
|
|
||||||
// }
|
|
||||||
// const events = _events();
|
|
||||||
// // Accept search by name or sku
|
|
||||||
// const results = events.filter(({ name, sku }) => name.toLowerCase().includes(query) || sku?.toLowerCase().includes(query));
|
|
||||||
// logger('[Event] search-results', results.length);
|
|
||||||
// return response({ results }, STATUS.OK);
|
|
||||||
|
|
||||||
// } catch (error) {
|
if (!query) {
|
||||||
return handleError('Event - Get search not implemented', {});
|
return response({ results: [] }, STATUS.OK);
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
const events = _events();
|
||||||
|
|
||||||
|
// Accept search by name or sku
|
||||||
|
const results = events.filter(({ name, sku }) => name.toLowerCase().includes(query) || sku?.toLowerCase().includes(query));
|
||||||
|
|
||||||
|
logger('[Event] search-results', results.length);
|
||||||
|
|
||||||
|
return response({ results }, STATUS.OK);
|
||||||
|
} catch (error) {
|
||||||
|
return handleError('Event - Get search', error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,7 @@ export async function POST(req: NextRequest) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const order = await createOrder(data);
|
const order = await createOrder(data);
|
||||||
return response(order, STATUS.OK);
|
return response(order, STATUS.CREATED);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError('Order - Create', error);
|
return handleError('Order - Create', error);
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,7 @@ export async function PUT(req: NextRequest) {
|
|||||||
if (!orderId) throw new Error('orderId cannot be null');
|
if (!orderId) throw new Error('orderId cannot be null');
|
||||||
const id: number = parseInt(orderId);
|
const id: number = parseInt(orderId);
|
||||||
|
|
||||||
const updatedOrder = await updateOrder(id.toString(), data);
|
const updatedOrder = await updateOrder(id, data);
|
||||||
return response(updatedOrder, STATUS.OK);
|
return response(updatedOrder, STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError('Order - Update', error);
|
return handleError('Order - Update', error);
|
||||||
@@ -68,7 +68,7 @@ export async function DELETE(req: NextRequest) {
|
|||||||
if (!orderId) throw new Error('orderId cannot be null');
|
if (!orderId) throw new Error('orderId cannot be null');
|
||||||
const id: number = parseInt(orderId);
|
const id: number = parseInt(orderId);
|
||||||
|
|
||||||
await deleteOrder(id.toString());
|
await deleteOrder(id);
|
||||||
return response({ success: true }, STATUS.OK);
|
return response({ success: true }, STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError('Order - Delete', error);
|
return handleError('Order - Delete', error);
|
||||||
|
@@ -24,14 +24,13 @@ export async function GET(req: NextRequest, res: NextResponse) {
|
|||||||
***************************************
|
***************************************
|
||||||
*/
|
*/
|
||||||
export async function POST(req: NextRequest) {
|
export async function POST(req: NextRequest) {
|
||||||
const OPERATION = 'Product - Create';
|
|
||||||
const { data } = await req.json();
|
const { data } = await req.json();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const product = await createProduct(data);
|
const product = await createProduct(data);
|
||||||
return response(OPERATION, STATUS.OK);
|
return response(product, STATUS.CREATED);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError(OPERATION, error);
|
return handleError('Product - Create', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
|
import prisma from '@/lib/prisma';
|
||||||
import { NextResponse } from 'next/server';
|
import { NextResponse } from 'next/server';
|
||||||
|
|
||||||
import prisma from 'src/app/lib/prisma';
|
|
||||||
|
|
||||||
// GET: 获取所有学生
|
// GET: 获取所有学生
|
||||||
export async function GET() {
|
export async function GET() {
|
||||||
try {
|
try {
|
||||||
|
@@ -14,8 +14,8 @@ export async function GET(req: NextRequest, res: NextResponse) {
|
|||||||
if (!userId) throw new Error('userId cannot be null');
|
if (!userId) throw new Error('userId cannot be null');
|
||||||
const result = await isAdmin(userId);
|
const result = await isAdmin(userId);
|
||||||
|
|
||||||
return response(result ? 'true' : 'false', STATUS.OK);
|
return response(result, STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError('GET - checkAdmin', error);
|
return handleError('Post - Get latest', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,8 +14,8 @@ export async function GET(req: NextRequest, res: NextResponse) {
|
|||||||
if (!userId) throw new Error('userId cannot be null');
|
if (!userId) throw new Error('userId cannot be null');
|
||||||
const result = await isAdmin(userId);
|
const result = await isAdmin(userId);
|
||||||
|
|
||||||
return response('GET - helloworld', STATUS.OK);
|
return response(result, STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError('GET - helloworld', error);
|
return handleError('Post - Get latest', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -22,17 +22,14 @@ export async function GET(req: NextRequest, res: NextResponse) {
|
|||||||
***************************************
|
***************************************
|
||||||
*/
|
*/
|
||||||
export async function POST(req: NextRequest) {
|
export async function POST(req: NextRequest) {
|
||||||
const OPERATION = 'User - Create';
|
|
||||||
const { data } = await req.json();
|
const { data } = await req.json();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// TODO: temporary ignore output from function due to `createNewUser` is still a dummy
|
const createResult = await createNewUser(data);
|
||||||
// const createResult = await createNewUser(data);
|
|
||||||
await createNewUser(data);
|
|
||||||
|
|
||||||
return response(OPERATION, STATUS.OK);
|
return response(createResult, STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError(OPERATION, error);
|
return handleError('User - Create', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +48,7 @@ export async function PUT(req: NextRequest) {
|
|||||||
if (!userId) throw new Error('userId cannot null');
|
if (!userId) throw new Error('userId cannot null');
|
||||||
const id: number = parseInt(userId);
|
const id: number = parseInt(userId);
|
||||||
|
|
||||||
const updateResult = await updateUser(id.toString(), data);
|
const updateResult = await updateUser(id, data);
|
||||||
|
|
||||||
return response(updateResult, STATUS.OK);
|
return response(updateResult, STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -74,10 +71,10 @@ export async function DELETE(req: NextRequest) {
|
|||||||
if (!userId) throw new Error('userId cannot null');
|
if (!userId) throw new Error('userId cannot null');
|
||||||
const id: number = parseInt(userId);
|
const id: number = parseInt(userId);
|
||||||
|
|
||||||
await deleteUser(id);
|
const deleteResult = await deleteUser(id);
|
||||||
|
|
||||||
return response('User - Delete', STATUS.OK);
|
return response(deleteResult, STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError('User - Delete', error);
|
return handleError('User - Update', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,15 +30,10 @@ async function listAccessLogs(): Promise<AccessLog[]> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: obsoleted getAccessLog, use getAccessLogById instead
|
|
||||||
async function getAccessLog(id: string): Promise<AccessLog | null> {
|
async function getAccessLog(id: string): Promise<AccessLog | null> {
|
||||||
return prisma.accessLog.findUnique({ where: { id } });
|
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> {
|
async function createAccessLog(userId?: string, message?: string, metadata?: Record<string, any>): Promise<AccessLog> {
|
||||||
return prisma.accessLog.create({
|
return prisma.accessLog.create({
|
||||||
data: {
|
data: {
|
||||||
@@ -49,10 +44,6 @@ async function createAccessLog(userId?: string, message?: string, metadata?: Rec
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function helloworld(): string {
|
|
||||||
return 'helloworld';
|
|
||||||
}
|
|
||||||
|
|
||||||
// async function update(id: string, data: UpdateAccessLog): Promise<AccessLog> {
|
// async function update(id: string, data: UpdateAccessLog): Promise<AccessLog> {
|
||||||
// return prisma.accessLog.update({
|
// return prisma.accessLog.update({
|
||||||
// where: { id },
|
// where: { id },
|
||||||
@@ -72,7 +63,4 @@ export {
|
|||||||
getAccessLog,
|
getAccessLog,
|
||||||
listAccessLogs,
|
listAccessLogs,
|
||||||
createAccessLog,
|
createAccessLog,
|
||||||
getAccessLogById,
|
|
||||||
//
|
|
||||||
helloworld,
|
|
||||||
};
|
};
|
||||||
|
@@ -6,14 +6,11 @@
|
|||||||
// RULES:
|
// RULES:
|
||||||
// - Follows same pattern as helloworld.service.ts
|
// - Follows same pattern as helloworld.service.ts
|
||||||
//
|
//
|
||||||
import type { Event } from '@prisma/client';
|
|
||||||
|
|
||||||
import prisma from '../lib/prisma';
|
|
||||||
|
|
||||||
type CreateEvent = {
|
type CreateEvent = {
|
||||||
eventDate: Date;
|
eventDate: DateTime;
|
||||||
title: string;
|
title: string;
|
||||||
joinMembers?: JSON[];
|
joinMembers?: Json[];
|
||||||
price: number;
|
price: number;
|
||||||
currency: string;
|
currency: string;
|
||||||
duration_m: number;
|
duration_m: number;
|
||||||
@@ -25,9 +22,9 @@ type CreateEvent = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type UpdateEvent = {
|
type UpdateEvent = {
|
||||||
eventDate?: Date;
|
eventDate?: DateTime;
|
||||||
title?: string;
|
title?: string;
|
||||||
joinMembers?: JSON[];
|
joinMembers?: Json[];
|
||||||
price?: number;
|
price?: number;
|
||||||
currency?: string;
|
currency?: string;
|
||||||
duration_m?: number;
|
duration_m?: number;
|
||||||
@@ -38,9 +35,9 @@ type UpdateEvent = {
|
|||||||
memberId?: number;
|
memberId?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
async function listEvents(): Promise<Event[]> {
|
// async function listEvents(): Promise<Event[]> {
|
||||||
return prisma.event.findMany();
|
// return prisma.event.findMany();
|
||||||
}
|
// }
|
||||||
|
|
||||||
// async function getEvent(eventId: number) {
|
// async function getEvent(eventId: number) {
|
||||||
// return prisma.event.findFirst({ where: { id: eventId } });
|
// return prisma.event.findFirst({ where: { id: eventId } });
|
||||||
|
@@ -12,9 +12,9 @@ import type { EventItem } from '@prisma/client';
|
|||||||
import prisma from '../lib/prisma';
|
import prisma from '../lib/prisma';
|
||||||
|
|
||||||
type CreateEvent = {
|
type CreateEvent = {
|
||||||
eventDate: Date;
|
eventDate: DateTime;
|
||||||
title: string;
|
title: string;
|
||||||
joinMembers?: JSON[];
|
joinMembers?: Json[];
|
||||||
price: number;
|
price: number;
|
||||||
currency: string;
|
currency: string;
|
||||||
duration_m: number;
|
duration_m: number;
|
||||||
@@ -26,9 +26,9 @@ type CreateEvent = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type UpdateEvent = {
|
type UpdateEvent = {
|
||||||
eventDate?: Date;
|
eventDate?: DateTime;
|
||||||
title?: string;
|
title?: string;
|
||||||
joinMembers?: JSON[];
|
joinMembers?: Json[];
|
||||||
price?: number;
|
price?: number;
|
||||||
currency?: string;
|
currency?: string;
|
||||||
duration_m?: number;
|
duration_m?: number;
|
||||||
|
@@ -11,24 +11,9 @@ import type { OrderItem } from '@prisma/client';
|
|||||||
import prisma from '../lib/prisma';
|
import prisma from '../lib/prisma';
|
||||||
|
|
||||||
type CreateOrderItem = {
|
type CreateOrderItem = {
|
||||||
// orderNumber?: string;
|
orderNumber?: string;
|
||||||
// status?: string;
|
// status?: string;
|
||||||
// eventIds?: number[];
|
// 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 = {
|
type UpdateOrderItem = {
|
||||||
|
@@ -38,7 +38,7 @@ async function getUserItem(userId: string): Promise<UserItem | null> {
|
|||||||
return prisma.userItem.findFirst({ where: { id: userId } });
|
return prisma.userItem.findFirst({ where: { id: userId } });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function updateUser(userId: string, updateForm: UpdateUser): Promise<UserItem> {
|
async function updateUser(userId: string, updateForm: UpdateUser): Promise<User> {
|
||||||
return prisma.userItem.update({
|
return prisma.userItem.update({
|
||||||
where: { id: userId },
|
where: { id: userId },
|
||||||
data: updateForm,
|
data: updateForm,
|
||||||
@@ -82,7 +82,7 @@ async function changeToUser(userIdToPromote: string, userIdOfApplicant: string)
|
|||||||
return promoteResult;
|
return promoteResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getUserById(id: string): Promise<UserItem | null> {
|
async function getUserById1(id: string): Promise<UserItem | null> {
|
||||||
return prisma.userItem.findFirst({ where: { id } });
|
return prisma.userItem.findFirst({ where: { id } });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -43,8 +43,7 @@
|
|||||||
"**/*.draft",
|
"**/*.draft",
|
||||||
"**/*.log",
|
"**/*.log",
|
||||||
"**/*.tmp",
|
"**/*.tmp",
|
||||||
"**/*del",
|
"**/*del"
|
||||||
"prisma/*"
|
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"next-env.d.ts",
|
"next-env.d.ts",
|
||||||
|
@@ -770,13 +770,6 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
tslib "^2.4.0"
|
tslib "^2.4.0"
|
||||||
|
|
||||||
"@types/bcrypt@^5.0.2":
|
|
||||||
version "5.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/bcrypt/-/bcrypt-5.0.2.tgz#22fddc11945ea4fbc3655b3e8b8847cc9f811477"
|
|
||||||
integrity sha512-6atioO8Y75fNcbmj0G7UjI9lXN2pQ/IGJ2FWT4a/btd0Lk9lQalHLKhkgKVZ3r+spnmWUKfbMi1GEe9wyHQfNQ==
|
|
||||||
dependencies:
|
|
||||||
"@types/node" "*"
|
|
||||||
|
|
||||||
"@types/estree@^1.0.6":
|
"@types/estree@^1.0.6":
|
||||||
version "1.0.7"
|
version "1.0.7"
|
||||||
resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz"
|
resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz"
|
||||||
@@ -797,13 +790,6 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.17.tgz#fb85a04f47e9e4da888384feead0de05f7070355"
|
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.17.tgz#fb85a04f47e9e4da888384feead0de05f7070355"
|
||||||
integrity sha512-RRVJ+J3J+WmyOTqnz3PiBLA501eKwXl2noseKOrNo/6+XEHjTAxO4xHvxQB6QuNm+s4WRbn6rSiap8+EA+ykFQ==
|
integrity sha512-RRVJ+J3J+WmyOTqnz3PiBLA501eKwXl2noseKOrNo/6+XEHjTAxO4xHvxQB6QuNm+s4WRbn6rSiap8+EA+ykFQ==
|
||||||
|
|
||||||
"@types/node@*":
|
|
||||||
version "24.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-24.0.1.tgz#e9bfcb1c35547437c294403b7bec497772a88b0a"
|
|
||||||
integrity sha512-MX4Zioh39chHlDJbKmEgydJDS3tspMP/lnQC67G3SWsTnb9NeYVWOjkxpOSy4oMfPs4StcWHwBrvUb4ybfnuaw==
|
|
||||||
dependencies:
|
|
||||||
undici-types "~7.8.0"
|
|
||||||
|
|
||||||
"@types/node@^22.13.13":
|
"@types/node@^22.13.13":
|
||||||
version "22.13.13"
|
version "22.13.13"
|
||||||
resolved "https://registry.npmjs.org/@types/node/-/node-22.13.13.tgz"
|
resolved "https://registry.npmjs.org/@types/node/-/node-22.13.13.tgz"
|
||||||
@@ -3500,11 +3486,6 @@ undici-types@~6.20.0:
|
|||||||
resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz"
|
resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz"
|
||||||
integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==
|
integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==
|
||||||
|
|
||||||
undici-types@~7.8.0:
|
|
||||||
version "7.8.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.8.0.tgz#de00b85b710c54122e44fbfd911f8d70174cd294"
|
|
||||||
integrity sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==
|
|
||||||
|
|
||||||
unique-names-generator@^4.7.1:
|
unique-names-generator@^4.7.1:
|
||||||
version "4.7.1"
|
version "4.7.1"
|
||||||
resolved "https://registry.yarnpkg.com/unique-names-generator/-/unique-names-generator-4.7.1.tgz#966407b12ba97f618928f77322cfac8c80df5597"
|
resolved "https://registry.yarnpkg.com/unique-names-generator/-/unique-names-generator-4.7.1.tgz#966407b12ba97f618928f77322cfac8c80df5597"
|
||||||
|
@@ -1,23 +1,14 @@
|
|||||||
#
|
|
||||||
# REQ0180 service port schedule
|
|
||||||
#
|
|
||||||
services:
|
services:
|
||||||
frontend:
|
frontend:
|
||||||
command: "sleep infinity"
|
command: 'sleep infinity'
|
||||||
ports:
|
|
||||||
- 8080:8080
|
|
||||||
|
|
||||||
mobile:
|
mobile:
|
||||||
command: "sleep infinity"
|
command: 'sleep infinity'
|
||||||
ports:
|
|
||||||
- 3000:3000
|
|
||||||
|
|
||||||
cms_backend:
|
cms_backend:
|
||||||
command: "sleep infinity"
|
command: 'sleep infinity'
|
||||||
ports:
|
|
||||||
- 7272:7272
|
|
||||||
- 5555:5555
|
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
|
# container_name: postgres
|
||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- '5432:5432'
|
||||||
|
@@ -1,6 +1,3 @@
|
|||||||
#
|
|
||||||
# REQ0180 service port schedule
|
|
||||||
#
|
|
||||||
volumes:
|
volumes:
|
||||||
db:
|
db:
|
||||||
driver: local
|
driver: local
|
||||||
@@ -14,8 +11,8 @@ services:
|
|||||||
- 10001:8080
|
- 10001:8080
|
||||||
volumes:
|
volumes:
|
||||||
- ../frontend:/app
|
- ../frontend:/app
|
||||||
working_dir: "/app"
|
working_dir: '/app'
|
||||||
command: "./scripts/20_prod.sh"
|
command: './dev.sh'
|
||||||
|
|
||||||
mobile:
|
mobile:
|
||||||
image: 192.168.10.61:5000/hksingleparty_mobile
|
image: 192.168.10.61:5000/hksingleparty_mobile
|
||||||
@@ -25,8 +22,8 @@ services:
|
|||||||
- 10004:3000
|
- 10004:3000
|
||||||
volumes:
|
volumes:
|
||||||
- ../mobile:/app
|
- ../mobile:/app
|
||||||
working_dir: "/app"
|
working_dir: '/app'
|
||||||
command: "./scripts/20_prod.sh"
|
command: './dev.sh'
|
||||||
|
|
||||||
cms_backend:
|
cms_backend:
|
||||||
image: 192.168.10.61:5000/demo_minimal_kit_backend
|
image: 192.168.10.61:5000/demo_minimal_kit_backend
|
||||||
@@ -39,8 +36,8 @@ services:
|
|||||||
- 10003:5555
|
- 10003:5555
|
||||||
volumes:
|
volumes:
|
||||||
- ../cms_backend:/app
|
- ../cms_backend:/app
|
||||||
working_dir: "/app"
|
working_dir: '/app'
|
||||||
command: "./scripts/20_prod.sh"
|
command: './dev.sh'
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:14.1-alpine
|
image: postgres:14.1-alpine
|
||||||
@@ -48,6 +45,6 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
expose:
|
expose:
|
||||||
- "5432"
|
- '5432'
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/postgresql/data
|
- db:/var/lib/postgresql/data
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
yarn --dev
|
yarn --dev
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
|
||||||
# yarn tsc:print
|
# yarn tsc:print
|
||||||
yarn lint:print
|
yarn lint:print
|
||||||
|
|
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
yarn build
|
|
@@ -1,10 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
yarn build
|
|
||||||
|
|
||||||
while true; do
|
|
||||||
yarn start
|
|
||||||
|
|
||||||
echo "restarting..."
|
|
||||||
sleep 1
|
|
||||||
done
|
|
@@ -1,83 +0,0 @@
|
|||||||
import type { AxiosRequestConfig } from 'axios';
|
|
||||||
import axios from 'axios';
|
|
||||||
import { CONFIG } from 'src/global-config';
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
const axiosInstance = axios.create({ baseURL: CONFIG.serverUrl });
|
|
||||||
|
|
||||||
axiosInstance.interceptors.response.use(
|
|
||||||
(response) => response,
|
|
||||||
(error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!')
|
|
||||||
);
|
|
||||||
|
|
||||||
export default axiosInstance;
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
export const fetcher = async (args: string | [string, AxiosRequestConfig]) => {
|
|
||||||
try {
|
|
||||||
const [url, config] = Array.isArray(args) ? args : [args];
|
|
||||||
|
|
||||||
const res = await axiosInstance.get(url, { ...config });
|
|
||||||
|
|
||||||
return res.data;
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Failed to fetch:', error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
export const endpoints = {
|
|
||||||
chat: '/api/chat',
|
|
||||||
kanban: '/api/kanban',
|
|
||||||
calendar: '/api/calendar',
|
|
||||||
auth: {
|
|
||||||
me: '/api/auth/me',
|
|
||||||
signIn: '/api/auth/sign-in',
|
|
||||||
signUp: '/api/auth/sign-up',
|
|
||||||
},
|
|
||||||
mail: {
|
|
||||||
list: '/api/mail/list',
|
|
||||||
details: '/api/mail/details',
|
|
||||||
labels: '/api/mail/labels',
|
|
||||||
},
|
|
||||||
post: {
|
|
||||||
list: '/api/post/list',
|
|
||||||
details: '/api/post/details',
|
|
||||||
latest: '/api/post/latest',
|
|
||||||
search: '/api/post/search',
|
|
||||||
},
|
|
||||||
product: {
|
|
||||||
list: '/api/product/list',
|
|
||||||
details: '/api/product/details',
|
|
||||||
search: '/api/product/search',
|
|
||||||
},
|
|
||||||
user: {
|
|
||||||
list: '/api/user/list',
|
|
||||||
profile: '/api/user/profile',
|
|
||||||
update: '/api/user/update',
|
|
||||||
settings: '/api/user/settings',
|
|
||||||
details: '/api/user/details',
|
|
||||||
},
|
|
||||||
order: {
|
|
||||||
list: '/api/order/list',
|
|
||||||
profile: '/api/order/profile',
|
|
||||||
update: '/api/order/update',
|
|
||||||
settings: '/api/order/settings',
|
|
||||||
details: '/api/order/details',
|
|
||||||
changeStatus: (orderId: string) => `/api/order/changeStatus?orderId=${orderId}`,
|
|
||||||
},
|
|
||||||
invoice: {
|
|
||||||
list: '/api/invoice/list',
|
|
||||||
profile: '/api/invoice/profile',
|
|
||||||
update: '/api/invoice/update',
|
|
||||||
saveInvoice: (invoiceId: string) => `/api/invoice/saveInvoice?invoiceId=${invoiceId}`,
|
|
||||||
settings: '/api/invoice/settings',
|
|
||||||
details: '/api/invoice/details',
|
|
||||||
changeStatus: (invoiceId: string) => `/api/invoice/changeStatus?invoiceId=${invoiceId}`,
|
|
||||||
search: '/api/invoice/search',
|
|
||||||
},
|
|
||||||
};
|
|
@@ -1,19 +0,0 @@
|
|||||||
import type { FirebaseApp } from 'firebase/app';
|
|
||||||
import type { Auth as AuthType } from 'firebase/auth';
|
|
||||||
import type { Firestore as FirestoreType } from 'firebase/firestore';
|
|
||||||
|
|
||||||
import { getAuth } from 'firebase/auth';
|
|
||||||
import { initializeApp } from 'firebase/app';
|
|
||||||
import { getFirestore } from 'firebase/firestore';
|
|
||||||
|
|
||||||
import { CONFIG } from 'src/global-config';
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
const isFirebase = CONFIG.auth.method === 'firebase';
|
|
||||||
|
|
||||||
export const firebaseApp = isFirebase ? initializeApp(CONFIG.firebase) : ({} as FirebaseApp);
|
|
||||||
|
|
||||||
export const AUTH = isFirebase ? getAuth(firebaseApp) : ({} as AuthType);
|
|
||||||
|
|
||||||
export const FIRESTORE = isFirebase ? getFirestore(firebaseApp) : ({} as FirestoreType);
|
|
@@ -1,16 +0,0 @@
|
|||||||
import type { SupabaseClient } from '@supabase/supabase-js';
|
|
||||||
|
|
||||||
import { createClient } from '@supabase/supabase-js';
|
|
||||||
|
|
||||||
import { CONFIG } from 'src/global-config';
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
const isSupabase = CONFIG.auth.method === 'supabase';
|
|
||||||
|
|
||||||
const supabaseUrl = CONFIG.supabase.url;
|
|
||||||
const supabaseKey = CONFIG.supabase.key;
|
|
||||||
|
|
||||||
export const supabase = isSupabase
|
|
||||||
? createClient(supabaseUrl, supabaseKey)
|
|
||||||
: ({} as SupabaseClient<any, 'public', any>);
|
|
@@ -31,16 +31,8 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
server: {
|
server: { port: PORT, host: true },
|
||||||
port: PORT,
|
preview: { port: PORT, host: true },
|
||||||
host: true,
|
|
||||||
allowedHosts: ['pa_admin.louislabs.com', 'localhost'],
|
|
||||||
},
|
|
||||||
preview: {
|
|
||||||
port: PORT,
|
|
||||||
host: true,
|
|
||||||
allowedHosts: ['pa_admin.louislabs.com', 'localhost'],
|
|
||||||
},
|
|
||||||
build: {
|
build: {
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
},
|
},
|
||||||
|
1
03_source/ionic-react-conference-app
Submodule
1
03_source/ionic-react-conference-app
Submodule
Submodule 03_source/ionic-react-conference-app added at 616068e5eb
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
@@ -10,7 +10,10 @@ set -ex
|
|||||||
|
|
||||||
npm run format
|
npm run format
|
||||||
|
|
||||||
|
git add .
|
||||||
|
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
|
git commit -m"build ok,"
|
||||||
|
|
||||||
echo "done"
|
echo "done"
|
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
npm run start
|
|
@@ -1,84 +0,0 @@
|
|||||||
import type { AxiosRequestConfig } from 'axios';
|
|
||||||
import axios from 'axios';
|
|
||||||
import { CONFIG } from '../global-config';
|
|
||||||
// import { CONFIG } from 'src/global-config';
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
const axiosInstance = axios.create({ baseURL: CONFIG.serverUrl });
|
|
||||||
|
|
||||||
axiosInstance.interceptors.response.use(
|
|
||||||
(response) => response,
|
|
||||||
(error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!')
|
|
||||||
);
|
|
||||||
|
|
||||||
export default axiosInstance;
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
export const fetcher = async (args: string | [string, AxiosRequestConfig]) => {
|
|
||||||
try {
|
|
||||||
const [url, config] = Array.isArray(args) ? args : [args];
|
|
||||||
|
|
||||||
const res = await axiosInstance.get(url, { ...config });
|
|
||||||
|
|
||||||
return res.data;
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Failed to fetch:', error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
export const endpoints = {
|
|
||||||
chat: '/api/chat',
|
|
||||||
kanban: '/api/kanban',
|
|
||||||
calendar: '/api/calendar',
|
|
||||||
auth: {
|
|
||||||
me: '/api/auth/me',
|
|
||||||
signIn: 'http://localhost:7272/api/auth/sign-in',
|
|
||||||
signUp: '/api/auth/sign-up',
|
|
||||||
},
|
|
||||||
mail: {
|
|
||||||
list: '/api/mail/list',
|
|
||||||
details: '/api/mail/details',
|
|
||||||
labels: '/api/mail/labels',
|
|
||||||
},
|
|
||||||
post: {
|
|
||||||
list: '/api/post/list',
|
|
||||||
details: '/api/post/details',
|
|
||||||
latest: '/api/post/latest',
|
|
||||||
search: '/api/post/search',
|
|
||||||
},
|
|
||||||
product: {
|
|
||||||
list: '/api/product/list',
|
|
||||||
details: '/api/product/details',
|
|
||||||
search: '/api/product/search',
|
|
||||||
},
|
|
||||||
user: {
|
|
||||||
list: '/api/user/list',
|
|
||||||
profile: '/api/user/profile',
|
|
||||||
update: '/api/user/update',
|
|
||||||
settings: '/api/user/settings',
|
|
||||||
details: '/api/user/details',
|
|
||||||
},
|
|
||||||
order: {
|
|
||||||
list: '/api/order/list',
|
|
||||||
profile: '/api/order/profile',
|
|
||||||
update: '/api/order/update',
|
|
||||||
settings: '/api/order/settings',
|
|
||||||
details: '/api/order/details',
|
|
||||||
changeStatus: (orderId: string) => `/api/order/changeStatus?orderId=${orderId}`,
|
|
||||||
},
|
|
||||||
invoice: {
|
|
||||||
list: '/api/invoice/list',
|
|
||||||
profile: '/api/invoice/profile',
|
|
||||||
update: '/api/invoice/update',
|
|
||||||
saveInvoice: (invoiceId: string) => `/api/invoice/saveInvoice?invoiceId=${invoiceId}`,
|
|
||||||
settings: '/api/invoice/settings',
|
|
||||||
details: '/api/invoice/details',
|
|
||||||
changeStatus: (invoiceId: string) => `/api/invoice/changeStatus?invoiceId=${invoiceId}`,
|
|
||||||
search: '/api/invoice/search',
|
|
||||||
},
|
|
||||||
};
|
|
3650
03_source/mobile/yarn.lock
Normal file
3650
03_source/mobile/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user