diff --git a/.github/workflows/zalo-mini-app.yml b/.github/workflows/zalo-mini-app.yml index 351e7ae..f5b7e16 100644 --- a/.github/workflows/zalo-mini-app.yml +++ b/.github/workflows/zalo-mini-app.yml @@ -62,7 +62,7 @@ jobs: cache: "npm" - run: npm install - run: npm install -g zmp-cli - - run: npx zmp-developer-token deploy ${{ matrix.mini-app-id }} + - run: printf "\\033[B\n$NEW_ACCESS_TOKEN" | APP_ID=${{ matrix.mini-app-id }} zmp login env: NEW_ACCESS_TOKEN: ${{ secrets.ZALO_ACCESS_TOKEN }} - name: Report 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: