feat(medusa, medusa-js, medusa-react): Implement Sales Channel list (#1815)

**What**
Support sales channel list in medusa, medusa-js and medusa-react

**How**

By implementing a new endpoint and the associated service method as well as the repository methods.

Medusa-js new list method in the resource

Medusa-react new hook in the queries

**Tests**

Endpoint test
Service test
Integration test
Hook tests

Fixes CORE-280
This commit is contained in:
Adrien de Peretti
2022-07-13 10:28:53 +00:00
committed by GitHub
parent c20d720040
commit a1a5848827
23 changed files with 750 additions and 53 deletions
@@ -0,0 +1,47 @@
import { removeUndefinedProperties } from "../remove-undefined-properties";
describe("removeUndefinedProperties", () => {
it("should remove all undefined properties from an input object", () => {
const inputObj = {
test: undefined,
test1: "test1",
test2: null,
test3: {
test3_1: undefined,
test3_2: "test3_2",
test3_3: null,
},
test4: [
undefined,
null,
"null",
[1, 2, undefined],
{
test4_1: undefined,
test4_2: "test4_2",
test4_3: null,
}
]
}
const cleanObject = removeUndefinedProperties(inputObj)
expect(cleanObject).toEqual({
test1: "test1",
test2: null,
test3: {
test3_2: "test3_2",
test3_3: null,
},
test4: [
null,
null,
[1, 2],
{
test4_2: "test4_2",
test4_3: null
}
]
})
})
})