feat: Add support for search to all endpoints (#7149)
* feat: Add search capability to api keys * feat: Add support for searching to currency and customer endpoints * fix: Clean up product search filters * feat: Add search support to regions * feat: Add search support to sales channels * feat: Add search support to store module * feat: Add search support to user module * fix: Clean up inventory search * feat: Add search support for payments * fix: Add searchable attributes to stock location models * feat: Add search support to tax * feat: Add search support to promotions * feat: Add search support for pricing, filtering cleanup * fix: Further cleanups around search
This commit is contained in:
@@ -343,6 +343,31 @@ medusaIntegrationTestRunner({
|
||||
])
|
||||
})
|
||||
|
||||
it("should support searching of regions", async () => {
|
||||
await service.create([
|
||||
{
|
||||
name: "APAC",
|
||||
currency_code: "usd",
|
||||
countries: ["jp"],
|
||||
},
|
||||
{
|
||||
name: "Europe",
|
||||
currency_code: "eur",
|
||||
countries: ["de"],
|
||||
},
|
||||
])
|
||||
|
||||
const response = await api.get(`/admin/regions?q=eu`, adminHeaders)
|
||||
|
||||
expect(response.status).toEqual(200)
|
||||
expect(response.data.regions).toEqual([
|
||||
expect.objectContaining({
|
||||
name: "Europe",
|
||||
currency_code: "eur",
|
||||
}),
|
||||
])
|
||||
})
|
||||
|
||||
it("should get a region", async () => {
|
||||
const [region] = await service.create([
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user