feat(core-flows, medusa): add update stock location endpoint to api-v2 (#6800)

* initial create

* add changeset

* redo changes for stock locatino module'

* initial update

* add changeset

* move integration tests

* update update method

* fix integration tests

* Update packages/stock-location-next/src/services/stock-location.ts

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>

* update service

* initial fixes

* pr feedback

* update types

* expand revert clause for update

* update versioning

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Philip Korsholm
2024-03-27 10:31:17 +01:00
committed by GitHub
parent 0b23e7efb8
commit 4cf71af07d
13 changed files with 378 additions and 27 deletions

View File

@@ -56,6 +56,35 @@ medusaIntegrationTestRunner({
})
})
describe("Update stock locations", () => {
let stockLocationId
beforeEach(async () => {
const createResponse = await api.post(
`/admin/stock-locations`,
{
name: "test location",
},
adminHeaders
)
stockLocationId = createResponse.data.stock_location.id
})
it("should update stock location name", async () => {
const response = await api.post(
`/admin/stock-locations/${stockLocationId}`,
{
name: "new name",
},
adminHeaders
)
expect(response.status).toEqual(200)
expect(response.data.stock_location.name).toEqual("new name")
})
})
describe("Get stock location", () => {
let locationId
const location = {