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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user