Compare commits

..

4 Commits

Author SHA1 Message Date
louiscklaw
043d45862c update markdown files and instructions in AI workspace 2025-06-15 13:16:53 +08:00
louiscklaw
8444b947a4 "update product list rendering" 2025-06-15 13:07:47 +08:00
louiscklaw
e791b01160 update, 2025-06-15 12:56:29 +08:00
louiscklaw
8383be13bc update, 2025-06-15 12:44:58 +08:00
7 changed files with 13 additions and 37 deletions

View File

@@ -1,30 +0,0 @@
// src/app/api/product/image/upload/route.ts
//
// PURPOSE:
// handle upload product image
//
// RULES:
// T.B.A.
import type { NextRequest } from 'next/server';
import { STATUS, response, handleError } from 'src/utils/response';
// import prisma from '../../../lib/prisma';
// ----------------------------------------------------------------------
/** **************************************
* GET - Products
*************************************** */
export async function POST(req: NextRequest) {
try {
const { data } = await req.json();
console.log('helloworld');
return response({ hello: 'world' }, STATUS.OK);
} catch (error) {
console.log({ hello: 'world' });
return handleError('Product - store product image', error);
}
}

View File

@@ -21,11 +21,11 @@ export async function GET(req: NextRequest) {
return response({ results: [] }, STATUS.OK);
}
const testResult = await getProductBySkuOrName(query);
const results = await getProductBySkuOrName(query);
logger('[Product] search-results', testResult?.length);
logger('[Product] search-results', results?.length);
return response({ testResult }, STATUS.OK);
return response({ results }, STATUS.OK);
} catch (error) {
return handleError('Product - Get search', error);
}

View File

@@ -3,3 +3,6 @@ GET http://localhost:7272/api/product/search?query=B
###
GET http://localhost:7272/api/product/search?query=Classic
###
GET http://localhost:7272/api/product/search?query=zzzzzz

View File

@@ -99,7 +99,9 @@ export async function createProduct(productData: IProductItem) {
* Work on server
*/
const data = { productData };
await axiosInstance.post(endpoints.product.create, data);
const {
data: { id },
} = await axiosInstance.post(endpoints.product.create, data);
/**
* Work in local
@@ -109,7 +111,7 @@ export async function createProduct(productData: IProductItem) {
(currentData: any) => {
const currentProducts: IProductItem[] = currentData?.products;
const products = [...currentProducts, productData];
const products = [...currentProducts, { ...productData, id }];
return { ...currentData, products };
},

View File

@@ -0,0 +1 @@
T.B.A.

View File

@@ -1,6 +1,6 @@
```markdown
# Greetings
```markdown
Hi,
Imagine you are a software engineer and i will send you the guideline.

View File

@@ -25,7 +25,7 @@ T.B.A.
1 AI tools/co-pilot
```prompt
please read and follow steps in the markdown files in `98_AI_workspace` folder thanks.
please read and follow steps in the markdown files in `98_AI_workspace/software-engineer` folder thanks.
```
<!-- AI: please fill the step to setup project below -->