chore(docs): merge changes from master (#3780)

* chore(docs): Generated API Reference (#3761)

Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>

* docs: fix typo (#3771)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
Co-authored-by: Andre Schweighofer <fidrelity@users.noreply.github.com>
This commit is contained in:
Shahed Nasser
2023-04-10 11:15:54 +03:00
committed by GitHub
parent 5280e1bdad
commit ae017c4657
46 changed files with 221 additions and 296 deletions

View File

@@ -0,0 +1,7 @@
import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token
medusa.admin.reservations.list()
.then(({ reservations, count, limit, offset }) => {
console.log(reservations.length)
})

View File

@@ -2,7 +2,11 @@ import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token
medusa.admin.reservations.create({
line_item_id: 'item_123',
location_id: 'loc_123',
inventory_item_id: 'iitem_123',
quantity: 1
})
.then(({ reservations }) => {
console.log(reservations.id);
.then(({ reservation }) => {
console.log(reservation.id);
});