Perbaikan Project PPOB
This commit is contained in:
		| @@ -65,6 +65,7 @@ export const PartnerComponent = observer((props) => { | ||||
|     setIsChangePassword(true); | ||||
|     store.partner.visibleModalPartner = true; | ||||
|     setIdData(data.id); | ||||
|     console.log(data.id); | ||||
|   }; | ||||
|  | ||||
|   const columns = [ | ||||
| @@ -161,20 +162,22 @@ export const PartnerComponent = observer((props) => { | ||||
|     if (idData !== "") { | ||||
|       modalLoader.setLoading(true); | ||||
|       try { | ||||
|         await store.partner.update(idData, data); | ||||
|         isChangePassword | ||||
|           ? await store.partner.updatePassword(idData, data) | ||||
|           : await store.partner.update(idData, data); | ||||
|         modalLoader.setLoading(false); | ||||
|         message.success( | ||||
|           isChangePassword | ||||
|             ? "Failed Change Partner Password" | ||||
|             ? "Success Change Password" | ||||
|             : "Success Update Data Partner" | ||||
|         ); | ||||
|  | ||||
|         //await store.partner.getData() | ||||
|       } catch (e) { | ||||
|         modalLoader.setLoading(true); | ||||
|         modalLoader.setLoading(false); | ||||
|         message.error( | ||||
|           isChangePassword | ||||
|             ? "Failed Change Partner Password" | ||||
|             ? "Failed Change Password" | ||||
|             : "Failed Update Data Partner" | ||||
|         ); | ||||
|       } | ||||
| @@ -280,7 +283,9 @@ export const PartnerComponent = observer((props) => { | ||||
|                             > | ||||
|                               {item?.status === true ? "Inactive" : "Active"} | ||||
|                             </Button> | ||||
|                             <Button onClick={(owner,name) => handleEditButton(item)}> | ||||
|                             <Button | ||||
|                               onClick={(owner, name) => handleEditButton(item)} | ||||
|                             > | ||||
|                               Edit | ||||
|                             </Button> | ||||
|                             {/* <Button onClick={() => handleDelete(record.id)}>Delete</Button> */} | ||||
|   | ||||
| @@ -108,7 +108,9 @@ export const ProductComponent = observer((props) => { | ||||
|       render: (text, record) => ( | ||||
|         <Button | ||||
|           onClick={async () => { | ||||
|               history.push(LINKS.PRODUCT_DETAIL.replace(":id", record.product_id)); | ||||
|             history.push( | ||||
|               LINKS.PRODUCT_DETAIL.replace(":id", record.product_id) | ||||
|             ); | ||||
|           }} | ||||
|         > | ||||
|           Detail | ||||
| @@ -258,7 +260,11 @@ export const ProductComponent = observer((props) => { | ||||
|             width: store.ui.mediaQuery.isMobile ? 250 : "", | ||||
|           }} | ||||
|           columns={columns} | ||||
|           dataSource={store.product.data} | ||||
|           dataSource={ | ||||
|             store.authentication.userData.role === "Admin Partner" | ||||
|               ? store.product.dataProductPartner | ||||
|               : store.product.data | ||||
|           } | ||||
|           bordered | ||||
|           pagination={{ | ||||
|             pageSize: store.product.pageSize, | ||||
|   | ||||
| @@ -192,14 +192,18 @@ export const SupplierComponent = observer((props) => { | ||||
|       try { | ||||
|         modalLoader.setLoading(true); | ||||
|         const response = await store.supplier.create(data); | ||||
|         response?.body?.statusCode === 201 || response?.body?.statusCode === 200 | ||||
|         console.log(response) | ||||
|         response?.body?.statusCode === 201 && response?.body?.statusCode === 200 | ||||
|           ? message.success( | ||||
|               response?.body?.message || "Berhasil Tambah Supplier Baru" | ||||
|             ) | ||||
|           : message.error( | ||||
|               response?.body?.statusCode === 406 | ||||
|               response?.body?.error | ||||
|                 ? response?.body?.error || "Supplier Sudah Ada" | ||||
|                 : response?.body?.message || "Gagal Tambah Supplier Baru" | ||||
|               // response?.body?.statusCode === 406 | ||||
|               //   ? response?.body?.error || "Supplier Sudah Ada" | ||||
|               //   : response?.body?.message || "Gagal Tambah Supplier Baru" | ||||
|               //response?.body?.message || "Gagal Tambah Supplier Baru" | ||||
|             ); | ||||
|       } catch (e) { | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| export const appConfig = { | ||||
|     // apiUrl: 'https://ppob-backend.k3s.bangun-kreatif.com/v1' | ||||
|     apiUrl: 'http://localhost:3222/v1' | ||||
|  apiUrl: 'https://ppob-backend.k3s.bangun-kreatif.com/v1' | ||||
|     //apiUrl: 'http://localhost:3222/v1' | ||||
|     // apiUrl: 'http://localhost:3222/v1' | ||||
| }; | ||||
|  | ||||
|   | ||||
| @@ -14,7 +14,7 @@ import { | ||||
|   PayCircleOutlined, | ||||
|   ProfileOutlined, | ||||
|   ShoppingCartOutlined, | ||||
|     UserOutlined | ||||
|   UserOutlined, | ||||
| } from "@ant-design/icons"; | ||||
| import { AppRoute, LINKS } from "../../routes/app"; | ||||
| import { useStore } from "../../utils/useStore"; | ||||
| @@ -118,20 +118,23 @@ export const DesktopLayout = observer(() => { | ||||
|             }} | ||||
|           > | ||||
|             <Menu> | ||||
|               {store.authentication.userData.role !== "Admin Partner" && ( | ||||
|                 <Menu.Item key="home"> | ||||
|                   <Link to={LINKS.HOME}> | ||||
|                     <HomeOutlined /> | ||||
|                     <span>Beranda</span> | ||||
|                   </Link> | ||||
|                 </Menu.Item> | ||||
|               {store.authentication.userData.role !== "Retail" && ( | ||||
|               )} | ||||
|               {store.authentication.userData.role !== "Retail" || | ||||
|                 (store.authentication.userData.role !== "Admin Partner" && ( | ||||
|                   <Menu.Item key="membership"> | ||||
|                     <Link to={LINKS.MEMBERSHIP}> | ||||
|                       <FileProtectOutlined /> | ||||
|                       <span>Keanggotaan</span> | ||||
|                     </Link> | ||||
|                   </Menu.Item> | ||||
|               )} | ||||
|                 ))} | ||||
|               {store.authentication.userData.role === "Admin" && ( | ||||
|                 <SubMenu | ||||
|                   key="config" | ||||
| @@ -197,14 +200,16 @@ export const DesktopLayout = observer(() => { | ||||
|                   </Link> | ||||
|                 </Menu.Item> | ||||
|               )} | ||||
|               {store.authentication.userData.role === "Retail" && ( | ||||
|               {store.authentication.userData.role === "Retail" || | ||||
|                 (store.authentication.userData.role === "Admin Partner" && ( | ||||
|                   <Menu.Item key="transaction"> | ||||
|                     <Link to={LINKS.TRANSACTION}> | ||||
|                       <ShoppingCartOutlined /> | ||||
|                       <span>Transaksi</span> | ||||
|                     </Link> | ||||
|                   </Menu.Item> | ||||
|               )} | ||||
|                 ))} | ||||
|               {store.authentication.userData.role !== "Admin Partner" && ( | ||||
|                 <SubMenu | ||||
|                   key="payback-main" | ||||
|                   icon={<ProfileOutlined />} | ||||
| @@ -227,6 +232,7 @@ export const DesktopLayout = observer(() => { | ||||
|                     </Menu.Item> | ||||
|                   )} | ||||
|                 </SubMenu> | ||||
|               )} | ||||
|               {store.authentication.userData.role !== "Admin" && ( | ||||
|                 <Menu.Item key="profile"> | ||||
|                   <Link to={LINKS.PROFILE}> | ||||
| @@ -364,13 +370,14 @@ export const DesktopLayout = observer(() => { | ||||
|                       }} | ||||
|                       mode="inline" | ||||
|                     > | ||||
|                           {store.authentication.userData.role !== "Admin" && <Menu.Item> | ||||
|                       {store.authentication.userData.role !== "Admin" && ( | ||||
|                         <Menu.Item> | ||||
|                           <Link to={LINKS.PROFILE}> | ||||
|                             <UserOutlined /> | ||||
|                             <span>Profile</span> | ||||
|                           </Link> | ||||
|                         </Menu.Item> | ||||
|                           } | ||||
|                       )} | ||||
|                       <Menu.Item | ||||
|                         onClick={() => { | ||||
|                           store.authentication.logout(); | ||||
| @@ -386,7 +393,7 @@ export const DesktopLayout = observer(() => { | ||||
|                     <Text> | ||||
|                       {store.user.data.username} | ||||
|                       <Paragraph | ||||
|                               style={{fontWeight: 400, marginTop: '0.5rem'}} | ||||
|                         style={{ fontWeight: 400, marginTop: "0.5rem" }} | ||||
|                         type={"secondary-dark"} | ||||
|                         strong | ||||
|                       > | ||||
| @@ -488,7 +495,7 @@ export const DesktopLayout = observer(() => { | ||||
|                 title={ | ||||
|                   <Text> | ||||
|                     <Paragraph | ||||
|                           style={{fontWeight: 400, marginTop: '0.5rem'}} | ||||
|                       style={{ fontWeight: 400, marginTop: "0.5rem" }} | ||||
|                       type={"secondary-dark"} | ||||
|                       strong | ||||
|                     > | ||||
|   | ||||
| @@ -23,8 +23,7 @@ const {SubMenu} = Menu; | ||||
|  | ||||
| export const MenuList = observer((props) => { | ||||
|   const store = useStore(); | ||||
|     useEffect(() => { | ||||
|     }, []); | ||||
|   useEffect(() => {}, []); | ||||
|  | ||||
|   const [setKeys, setSetKeys] = useState(["dashboard"]); | ||||
|  | ||||
| @@ -47,13 +46,16 @@ export const MenuList = observer((props) => { | ||||
|       overflowedIndicator={0} | ||||
|       forceSubMenuRender={true} | ||||
|     > | ||||
|       {store.authentication.userData.role === "Admin" && ( | ||||
|         <Menu.Item key="home"> | ||||
|           <Link to={LINKS.HOME}> | ||||
|             <HomeOutlined /> | ||||
|             <span>Beranda</span> | ||||
|           </Link> | ||||
|         </Menu.Item> | ||||
|       {store.authentication.userData.role !== "Retail" && ( | ||||
|       )} | ||||
|       {store.authentication.userData.role !== "Retail" && | ||||
|         store.authentication.userData.role !== "Admin Partner" && ( | ||||
|           <Menu.Item key="membership"> | ||||
|             <Link to={LINKS.MEMBERSHIP}> | ||||
|               <FileProtectOutlined /> | ||||
| @@ -109,6 +111,14 @@ export const MenuList = observer((props) => { | ||||
|           )} | ||||
|         </SubMenu> | ||||
|       )} | ||||
|       {store.authentication.userData.role === "Admin Partner" && ( | ||||
|         <Menu.Item key="retail"> | ||||
|           <Link to={LINKS.PRODUCT}> | ||||
|             <DatabaseOutlined /> | ||||
|             <span>Produk</span> | ||||
|           </Link> | ||||
|         </Menu.Item> | ||||
|       )} | ||||
|       {store.authentication.userData.role === "Supervisor" && ( | ||||
|         <Menu.Item key="retail"> | ||||
|           <Link to={LINKS.PRODUCT}> | ||||
| @@ -117,15 +127,22 @@ export const MenuList = observer((props) => { | ||||
|           </Link> | ||||
|         </Menu.Item> | ||||
|       )} | ||||
|       {store.authentication.userData.role === "Retail" && ( | ||||
|       {store.authentication.userData.role === "Retail" || | ||||
|         (store.authentication.userData.role === "Admin Partner" && ( | ||||
|           <Menu.Item key="transaction"> | ||||
|             <Link to={LINKS.TRANSACTION}> | ||||
|               <ShoppingCartOutlined /> | ||||
|               <span>Transaksi</span> | ||||
|             </Link> | ||||
|           </Menu.Item> | ||||
|       )} | ||||
|       <SubMenu key="payback-main" icon={<ProfileOutlined />} title="Pembayaran"> | ||||
|         ))} | ||||
|       {store.authentication.userData.role !== "Retail" && | ||||
|         store.authentication.userData.role !== "Admin Partner" && ( | ||||
|           <SubMenu | ||||
|             key="payback-main" | ||||
|             icon={<ProfileOutlined />} | ||||
|             title="Pembayaran" | ||||
|           > | ||||
|             {store.authentication.userData.role !== "Retail" && ( | ||||
|               <Menu.Item key="payback-to-user"> | ||||
|                 <Link to={LINKS.PAYBACK}> | ||||
| @@ -143,6 +160,7 @@ export const MenuList = observer((props) => { | ||||
|               </Menu.Item> | ||||
|             )} | ||||
|           </SubMenu> | ||||
|         )} | ||||
|       {store.authentication.userData.role !== "Admin" && ( | ||||
|         <Menu.Item key="profile"> | ||||
|           <Link to={LINKS.PROFILE}> | ||||
|   | ||||
| @@ -38,7 +38,7 @@ export const Commission = observer(() => { | ||||
|   const routeData = [ | ||||
|     { | ||||
|       route: LINKS.HOME, | ||||
|       name: "Home", | ||||
|       name: "Beranda", | ||||
|     }, | ||||
|     { | ||||
|       route: LINKS.COMMISSION, | ||||
|   | ||||
| @@ -36,7 +36,7 @@ export const Partner = observer(() => { | ||||
|   const routeData = [ | ||||
|     { | ||||
|       route: LINKS.HOME, | ||||
|       name: "Home", | ||||
|       name: "Beranda", | ||||
|     }, | ||||
|     { | ||||
|       route: LINKS.PARTNER, | ||||
|   | ||||
| @@ -51,7 +51,7 @@ export const Supplier = observer(() => { | ||||
|   const routeData = [ | ||||
|     { | ||||
|       route: LINKS.HOME, | ||||
|       name: "Home", | ||||
|       name: "Beranda", | ||||
|     }, | ||||
|     { | ||||
|       route: LINKS.SUPPLIER, | ||||
|   | ||||
| @@ -1,25 +1,123 @@ | ||||
| import React from "react"; | ||||
| import {Button, PageHeader} from "antd"; | ||||
| import { Button, PageHeader, Card, Row, Col, List } from "antd"; | ||||
| import { store } from "../../utils/useStore"; | ||||
| import { observer } from "mobx-react-lite"; | ||||
| import { FilterOutlined, TransactionOutlined } from "@ant-design/icons"; | ||||
|  | ||||
| export const Home = observer(() => { | ||||
|     return <div className={["ppob-container"].join(" ")}> | ||||
|         <PageHeader | ||||
|   return ( | ||||
|     <div> | ||||
|       {store.ui.mediaQuery.isDesktop && ( | ||||
|         <Row | ||||
|           style={{ | ||||
|                 padding: 0, | ||||
|                 margin: 0, | ||||
|                 height: 40, | ||||
|                 backgroundColor: "transparent", | ||||
|             marginTop: 30, | ||||
|             marginLeft: 30, | ||||
|           }} | ||||
|             title={"Home"} | ||||
|         > | ||||
|           <Card | ||||
|             className={"shadow"} | ||||
|             style={{ | ||||
|               marginLeft: 20, | ||||
|               height: 200, | ||||
|               marginBottom: 10, | ||||
|               width: "30%", | ||||
|             }} | ||||
|           > | ||||
|             <PageHeader title={<span>Total Transaksi</span>}> | ||||
|               <span>Total Transaksi : 25 Transaksi</span> | ||||
|             </PageHeader> | ||||
|         <Button onClick={() => { | ||||
|             store.ui.setTestValue(); | ||||
|         }}>{store.ui.testValue}</Button> | ||||
|         Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus aut recusandae velit! Consequatur corporis, | ||||
|         eum fuga, harum incidunt laboriosam minus necessitatibus neque non nostrum pariatur tempore. Dignissimos impedit | ||||
|         rem tempora! | ||||
|           </Card> | ||||
|           <Card | ||||
|             className={"shadow"} | ||||
|             style={{ | ||||
|               marginLeft: 20, | ||||
|               height: 200, | ||||
|               marginBottom: 10, | ||||
|               width: "30%", | ||||
|             }} | ||||
|           > | ||||
|             <PageHeader title={<span>Total Keuntungan</span>}> | ||||
|               <span>Rp.30.000.000</span> | ||||
|             </PageHeader> | ||||
|           </Card> | ||||
|           <Card | ||||
|             className={"shadow"} | ||||
|             hoverable | ||||
|             style={{ | ||||
|               marginLeft: 20, | ||||
|               height: 200, | ||||
|               marginBottom: 10, | ||||
|               width: "30%", | ||||
|             }} | ||||
|           > | ||||
|             <PageHeader title={<span>Saldo</span>}> | ||||
|               <span>Rp.200.000.000 </span> | ||||
|             </PageHeader> | ||||
|           </Card> | ||||
|         </Row> | ||||
|       )} | ||||
|       {store.ui.mediaQuery.isMobile && ( | ||||
|         <div style={{ marginTop: 10 }}> | ||||
|           <Card | ||||
|             className={"shadow"} | ||||
|             style={{ | ||||
|               marginLeft: 20, | ||||
|               height: 200, | ||||
|               marginBottom: 10, | ||||
|               marginRight: 20, | ||||
|             }} | ||||
|           > | ||||
|             <PageHeader title={<span>Total Transaksi</span>}> | ||||
|               <span>Total Transaksi :</span> | ||||
|             </PageHeader> | ||||
|           </Card> | ||||
|           <Card | ||||
|             className={"shadow"} | ||||
|             style={{ | ||||
|               marginLeft: 20, | ||||
|               height: 200, | ||||
|               marginBottom: 10, | ||||
|               marginRight: 20, | ||||
|             }} | ||||
|           > | ||||
|             <PageHeader title={<span>Total Keuntungan</span>}> | ||||
|               <span>Rp.30.000.000</span> | ||||
|             </PageHeader> | ||||
|           </Card> | ||||
|           <Card | ||||
|             className={"shadow"} | ||||
|             hoverable | ||||
|             style={{ | ||||
|               marginLeft: 20, | ||||
|               height: 200, | ||||
|               marginBottom: 10, | ||||
|               marginRight: 20, | ||||
|             }} | ||||
|           > | ||||
|             <PageHeader title={<span>Saldo</span>}> | ||||
|               <span>Rp.200.000.000 </span> | ||||
|             </PageHeader> | ||||
|           </Card> | ||||
|         </div> | ||||
|       )} | ||||
|     </div> | ||||
|   ); | ||||
|   // return <div className={["ppob-container"].join(" ")}> | ||||
|   //     <PageHeader | ||||
|   //         style={{ | ||||
|   //             padding: 0, | ||||
|   //             margin: 0, | ||||
|   //             height: 40, | ||||
|   //             backgroundColor: "transparent", | ||||
|   //         }} | ||||
|   //         title={"Home"} | ||||
|   //     > | ||||
|   //     </PageHeader> | ||||
|   //     <Button onClick={() => { | ||||
|   //         store.ui.setTestValue(); | ||||
|   //     }}>{store.ui.testValue}</Button> | ||||
|   //     Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus aut recusandae velit! Consequatur corporis, | ||||
|   //     eum fuga, harum incidunt laboriosam minus necessitatibus neque non nostrum pariatur tempore. Dignissimos impedit | ||||
|   //     rem tempora! | ||||
|   // </div> | ||||
| }); | ||||
|   | ||||
| @@ -174,7 +174,7 @@ export const Membership = observer(() => { | ||||
|   const routeData = [ | ||||
|     { | ||||
|       route: LINKS.HOME, | ||||
|       name: "Home", | ||||
|       name: "Beranda", | ||||
|     }, | ||||
|     { | ||||
|       route: LINKS.MEMBERSHIP, | ||||
|   | ||||
| @@ -163,7 +163,7 @@ export const Payback = observer(() => { | ||||
|   const routeData = [ | ||||
|     { | ||||
|       route: LINKS.HOME, | ||||
|       name: "Home", | ||||
|       name: "Beranda", | ||||
|     }, | ||||
|     { | ||||
|       route: LINKS.PAYBACK, | ||||
| @@ -175,15 +175,23 @@ export const Payback = observer(() => { | ||||
|     modalLoader.setLoading(true); | ||||
|     try { | ||||
|       const response = await store.payback.confirmPayback(id, type); | ||||
|       if (response.body.status !== 201) { | ||||
|         message.error( | ||||
|       console.log(response) | ||||
|       response.body.statusCode !== 201 && response.body.statusCode !== 200 | ||||
|         ? message.error( | ||||
|             response?.body?.message || `Failed ${capitalize(type)} Payback` | ||||
|         ); | ||||
|       } else { | ||||
|         message.success( | ||||
|           ) | ||||
|         : message.success( | ||||
|             response?.body?.message || `Success ${capitalize(type)} Payback` | ||||
|           ); | ||||
|       } | ||||
|       // if (response.body.status !== 201 ) { | ||||
|       //   message.error( | ||||
|       //     response?.body?.message || `Failed ${capitalize(type)} Payback` | ||||
|       //   ); | ||||
|       // } else { | ||||
|       //   message.success( | ||||
|       //     response?.body?.message || `Success ${capitalize(type)} Payback` | ||||
|       //   ); | ||||
|       // } | ||||
|     } catch (e) { | ||||
|       console.error(e, "apa errornya"); | ||||
|       message.error( | ||||
| @@ -200,10 +208,10 @@ export const Payback = observer(() => { | ||||
|         <div> | ||||
|           <Row style={{ marginBottom: 20 }}> | ||||
|             <Col span={12}> | ||||
|               <Button> | ||||
|               {/* <Button> | ||||
|                 <FilterOutlined /> | ||||
|                 Filter | ||||
|               </Button> | ||||
|               </Button> */} | ||||
|             </Col> | ||||
|             <Col span={12} style={{ textAlign: "right" }}> | ||||
|               {/* <Search | ||||
|   | ||||
| @@ -80,7 +80,7 @@ export const PaybackCreated = observer(() => { | ||||
|   const routeData = [ | ||||
|     { | ||||
|       route: LINKS.HOME, | ||||
|       name: "Home", | ||||
|       name: "Beranda", | ||||
|     }, | ||||
|     { | ||||
|       route: LINKS.PAYBACK_CREATED, | ||||
|   | ||||
| @@ -37,7 +37,7 @@ export const Category = observer(() => { | ||||
|   const routeData = [ | ||||
|     { | ||||
|       route: LINKS.HOME, | ||||
|       name: "Home", | ||||
|       name: "Beranda", | ||||
|     }, | ||||
|     { | ||||
|       route: LINKS.CATEGORY, | ||||
|   | ||||
| @@ -30,6 +30,7 @@ export const Product = observer(() => { | ||||
|           store.supplier.getData(), | ||||
|           store.category.getData(), | ||||
|           store.product.getDataSubCategories(), | ||||
|           store.product.getProductPartner() | ||||
|         ]); | ||||
|         await store.product.getData(); | ||||
|         modalLoader.setLoading(false); | ||||
| @@ -53,7 +54,7 @@ export const Product = observer(() => { | ||||
|   const routeData = [ | ||||
|     { | ||||
|       route: LINKS.HOME, | ||||
|       name: "Home", | ||||
|       name: "Beranda", | ||||
|     }, | ||||
|     { | ||||
|       route: LINKS.PRODUCT, | ||||
|   | ||||
| @@ -18,7 +18,7 @@ export const ProductDetail = observer(() => { | ||||
|   const routeData = [ | ||||
|     { | ||||
|       route: LINKS.HOME, | ||||
|       name: "Home", | ||||
|       name: "Beranda", | ||||
|     }, | ||||
|     { | ||||
|       route: LINKS.PRODUCT, | ||||
|   | ||||
| @@ -41,7 +41,7 @@ export const Subcategory = observer(() => { | ||||
|   const routeData = [ | ||||
|     { | ||||
|       route: LINKS.HOME, | ||||
|       name: "Home", | ||||
|       name: "Beranda", | ||||
|     }, | ||||
|     { | ||||
|       route: LINKS.SUBCATEGORY, | ||||
|   | ||||
| @@ -138,12 +138,12 @@ export const Profile = observer(() => { | ||||
|             <div> | ||||
|               <Title strong level={3}>History User Transaction</Title> | ||||
|  | ||||
|               <Button style={{marginBottom: '1rem'}} onClick={() => { | ||||
|               {/* <Button style={{marginBottom: '1rem'}} onClick={() => { | ||||
|                 console.log('clicked filter') | ||||
|               }}> | ||||
|                 <FilterOutlined/> | ||||
|                 Filter | ||||
|               </Button> | ||||
|               </Button> */} | ||||
|               <Table | ||||
|                   columns={columns} | ||||
|                   bordered | ||||
|   | ||||
| @@ -46,7 +46,7 @@ export const Transaction = observer(() => { | ||||
|   const routeData = [ | ||||
|     { | ||||
|       route: LINKS.HOME, | ||||
|       name: "Home", | ||||
|       name: "Beranda", | ||||
|     }, | ||||
|     { | ||||
|       route: LINKS.TRANSACTION, | ||||
|   | ||||
| @@ -27,7 +27,7 @@ export class Partner { | ||||
|     async getData() { | ||||
|         try { | ||||
|             const response = await http.get(`/users/partner?page=${this.page}&pageSize=${this.pageSize}`); | ||||
|  | ||||
|             //console.log(response) | ||||
|             this.data = response.body.data.map((item, idx) => { | ||||
|                 item.key = idx; | ||||
|                 return item | ||||
| @@ -59,11 +59,12 @@ export class Partner { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     // async updateStatus(id, data) { | ||||
|     //     const response = await http.put(`/users/partner/${id}`).send(data); | ||||
|     //     await this.getData(); | ||||
|     //     return response; | ||||
|     // } | ||||
|     async updatePassword(id, data) { | ||||
|         const response = await http.put(`/users/change-password-partner/${id}`).send(data); | ||||
|         console.log(response) | ||||
|         await this.getData(); | ||||
|         return response; | ||||
|     } | ||||
|  | ||||
|     async delete(id) { | ||||
|         try { | ||||
|   | ||||
| @@ -26,9 +26,11 @@ export class Product { | ||||
|     dataPriceHistory = []; | ||||
|     totalDataPriceHistory = 0; | ||||
|     pagePriceHistory = 0; | ||||
|     pageProductPartner = 0; | ||||
|     pageSizePriceHistory = 10 | ||||
|  | ||||
|     dataDetailProduct = {}; | ||||
|     dataProductPartner=[] | ||||
|  | ||||
|     constructor(ctx) { | ||||
|         this.ctx = ctx; | ||||
| @@ -94,6 +96,16 @@ export class Product { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     async getProductPartner(id) { | ||||
|         try { | ||||
|             const response = await http.get(`/product/by-categories?page=${this.pageProductPartner}&sub-category=${id}`); | ||||
|             console.log(response) | ||||
|             this.dataProductPartner = response.body.data | ||||
|         } catch (e) { | ||||
|             console.error(e); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     async create(data) { | ||||
|         try { | ||||
|             const response = await http.post('/product').send(data); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user