Skip to content

Commit

Permalink
chore: publish 1.0.0-rc.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Baroshem committed Nov 20, 2024
1 parent 5d6f6e9 commit 706ea4d
Show file tree
Hide file tree
Showing 5 changed files with 3,225 additions and 2,241 deletions.
10 changes: 9 additions & 1 deletion .stackblitz/app.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<script lang="ts" setup>
const client = useMedusaClient();
const { products } = await client.products.list();
// Client fetching
const { regions } = await client.store.region.list()
const { products } = await client.store.product.list({
region_id: regions[0].id,
fields: `*variants.calculated_price`
});
// Server Fetching
const { data } = await useFetch('/api/products')
</script>

Expand Down
4 changes: 2 additions & 2 deletions .stackblitz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"postinstall": "nuxt prepare"
},
"devDependencies": {
"nuxt": "3.3.1"
"nuxt": "latest"
},
"dependencies": {
"nuxt-medusa": "^0.5.0"
"nuxt-medusa": "latest"
}
}
6 changes: 5 additions & 1 deletion .stackblitz/server/api/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { serverMedusaClient } from '#medusa/server'

export default eventHandler(async (event) => {
const client = serverMedusaClient(event)
const { products } = await client.products.list()
const { regions } = await client.store.region.list()
const { products } = await client.store.product.list({
region_id: regions[0].id,
fields: `*variants.calculated_price`
})

return { products }
})
Loading

0 comments on commit 706ea4d

Please sign in to comment.