From c66fe450589da2ca82175cb4f24bc82e1cb60d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=E1=BB=93ng=20Ph=C3=A1t?= Date: Wed, 31 Jan 2024 15:56:02 +0700 Subject: [PATCH] update document --- README.md | 4 ++++ package-lock.json | 8 ++++---- package.json | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 164cd72..f0c824a 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,8 @@ Folder structure: - **`global.d.ts`**: Contains TypeScript declarations for third-party modules and global objects. - **`state.ts`**: State management, containing Recoil's atoms and selectors (https://recoiljs.org/docs/introduction/getting-started#atom). +- **`mock`**: Example data as \*.json files. + - **`app-config.json`**: Global configuration for your Mini App (https://mini.zalo.me/docs/framework/getting-started/app-config). The other files (such as `tailwind.config.js`, `vite.config.ts`, `tsconfig.json`, `postcss.config.js`) are configurations for libraries used in your application. Visit the library's documentation to learn how to use them. @@ -119,6 +121,8 @@ You can customizations primary colors and currency displays using [Zalo Mini App Products fetching +For a simple MVP, you can put in your store products and categories as simply as making changes to `mock/*.json` files. However, a typical application would likely need to fetch data over REST API. + To make an HTTP GET request to your server and fetch the product list, update the `productsState` selector in src/state.ts to use `fetch`. If the returned JSON structure is different from the template, you would need to map your product object to the corresponding `Product` interface. For example: diff --git a/package-lock.json b/package-lock.json index d85723c..0a744c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "react-router-dom": "^6.8.2", "recoil": "^0.7.7", "swiper": "^9.1.0", - "zmp-sdk": "^2.35.2", + "zmp-sdk": "^2.35.3", "zmp-ui": "^1.6.0-rc.6" }, "devDependencies": { @@ -4689,9 +4689,9 @@ } }, "node_modules/zmp-sdk": { - "version": "2.35.2", - "resolved": "https://registry.npmjs.org/zmp-sdk/-/zmp-sdk-2.35.2.tgz", - "integrity": "sha512-YeZrEP+l3uVvo7pGf7IaWgqZJNvtoq4OpFvydsbx3Bn0Xn4tYqQm2XBwr97Uvbymtuycg4xxYM7pYBLOEJONGA==", + "version": "2.35.3", + "resolved": "https://registry.npmjs.org/zmp-sdk/-/zmp-sdk-2.35.3.tgz", + "integrity": "sha512-IXHIa44UgGkHmyFJZ0NMvS+cGvOzsLxMBQyhZlrd7WKdwddA7MZxLuYAu3M9rC/M5v+p8OD+qFtggPplzxuw/g==", "dependencies": { "@babel/cli": "^7.17.6", "@sentry/browser": "^6.9.0", diff --git a/package.json b/package.json index 93ebf11..e0943e7 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "react-router-dom": "^6.8.2", "recoil": "^0.7.7", "swiper": "^9.1.0", - "zmp-sdk": "^2.35.2", + "zmp-sdk": "^2.35.3", "zmp-ui": "^1.6.0-rc.6" }, "devDependencies": {