Skip to content

Commit

Permalink
update document
Browse files Browse the repository at this point in the history
  • Loading branch information
mister-teddy committed Jan 31, 2024
1 parent d85ac2d commit bb01b6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/zalo-mini-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -119,6 +121,8 @@ You can customizations primary colors and currency displays using [Zalo Mini App

<img src="./docs/products-fetching.webp" alt="Products fetching" width="250" align="right">

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:
Expand Down

0 comments on commit bb01b6b

Please sign in to comment.