"implement product CRUD API endpoints and frontend integration"

This commit is contained in:
louiscklaw
2025-06-15 02:47:25 +08:00
parent 48e90bca1b
commit f53cf9d932
30 changed files with 623 additions and 342 deletions

View File

@@ -1,10 +1,8 @@
// src/pages/dashboard/product/details.tsx
import { useParams } from 'src/routes/hooks';
import { CONFIG } from 'src/global-config';
import { useGetProduct } from 'src/actions/product';
import { CONFIG } from 'src/global-config';
import { useParams } from 'src/routes/hooks';
import { ProductDetailsView } from 'src/sections/product/view';
// ----------------------------------------------------------------------
@@ -14,7 +12,7 @@ const metadata = { title: `Product details | Dashboard - ${CONFIG.appName}` };
export default function Page() {
const { id = '' } = useParams();
const { currentProduct: product, productLoading, productError } = useGetProduct(id);
const { product, productLoading, productError } = useGetProduct(id);
return (
<>

View File

@@ -1,8 +1,6 @@
import { useParams } from 'src/routes/hooks';
import { CONFIG } from 'src/global-config';
import { useGetProduct } from 'src/actions/product';
import { CONFIG } from 'src/global-config';
import { useParams } from 'src/routes/hooks';
import { ProductEditView } from 'src/sections/product/view';
// ----------------------------------------------------------------------
@@ -12,13 +10,13 @@ const metadata = { title: `Product edit | Dashboard - ${CONFIG.appName}` };
export default function Page() {
const { id = '' } = useParams();
const { currentProduct } = useGetProduct(id);
const { product } = useGetProduct(id);
return (
<>
<title>{metadata.title}</title>
<ProductEditView product={currentProduct} />
<ProductEditView product={product} />
</>
);
}

View File

@@ -1,5 +1,5 @@
// src/pages/dashboard/product/list.tsx
//
import { CONFIG } from 'src/global-config';
import { ProductListView } from 'src/sections/product/view';

View File

@@ -12,7 +12,7 @@ const metadata = { title: `Product details - ${CONFIG.appName}` };
export default function Page() {
const { id = '' } = useParams();
const { currentProduct: product, productLoading, productError } = useGetProduct(id);
const { product, productLoading, productError } = useGetProduct(id);
return (
<>

View File

@@ -0,0 +1,5 @@
function Helloworld() {
return <>helloworld</>;
}
export default Helloworld;

View File

@@ -1,6 +1,5 @@
import { CONFIG } from 'src/global-config';
import { useGetProducts } from 'src/actions/product';
import { CONFIG } from 'src/global-config';
import { ProductShopView } from 'src/sections/product/view';
// ----------------------------------------------------------------------