fix: Switch to zod for customer endpoints, fix inconsistencies (#7094)
This commit is contained in:
@@ -13,7 +13,7 @@ const adminHeaders = {
|
||||
medusaIntegrationTestRunner({
|
||||
env,
|
||||
testSuite: ({ dbConnection, getContainer, api }) => {
|
||||
describe("POST /admin/customer-groups/:id/customers/batch/add", () => {
|
||||
describe("POST /admin/customer-groups/:id/customers/batch", () => {
|
||||
let appContainer
|
||||
let customerModuleService: ICustomerModuleService
|
||||
|
||||
@@ -48,9 +48,9 @@ medusaIntegrationTestRunner({
|
||||
])
|
||||
|
||||
const response = await api.post(
|
||||
`/admin/customer-groups/${group.id}/customers/batch/add`,
|
||||
`/admin/customer-groups/${group.id}/customers/batch`,
|
||||
{
|
||||
customer_ids: customers.map((c) => ({ id: c.id })),
|
||||
create: customers.map((c) => c.id),
|
||||
},
|
||||
adminHeaders
|
||||
)
|
||||
|
||||
@@ -13,7 +13,7 @@ const adminHeaders = {
|
||||
medusaIntegrationTestRunner({
|
||||
env,
|
||||
testSuite: ({ dbConnection, getContainer, api }) => {
|
||||
describe("POST /admin/customer-groups/:id/customers/batch/remove", () => {
|
||||
describe("POST /admin/customer-groups/:id/customers/batch", () => {
|
||||
let appContainer
|
||||
let customerModuleService: ICustomerModuleService
|
||||
|
||||
@@ -55,9 +55,9 @@ medusaIntegrationTestRunner({
|
||||
)
|
||||
|
||||
const response = await api.post(
|
||||
`/admin/customer-groups/${group.id}/customers/batch/remove`,
|
||||
`/admin/customer-groups/${group.id}/customers/batch`,
|
||||
{
|
||||
customer_ids: customers.map((c) => ({ id: c.id })),
|
||||
delete: customers.map((c) => c.id),
|
||||
},
|
||||
adminHeaders
|
||||
)
|
||||
|
||||
@@ -13,7 +13,7 @@ const adminHeaders = {
|
||||
medusaIntegrationTestRunner({
|
||||
env,
|
||||
testSuite: ({ dbConnection, getContainer, api }) => {
|
||||
describe("GET /admin/customer-groups/:id/customers", () => {
|
||||
describe("GET customer group customers", () => {
|
||||
let appContainer
|
||||
let customerModuleService: ICustomerModuleService
|
||||
|
||||
@@ -54,7 +54,7 @@ medusaIntegrationTestRunner({
|
||||
)
|
||||
|
||||
const response = await api.get(
|
||||
`/admin/customer-groups/${group.id}/customers`,
|
||||
`/admin/customers?groups[]=${group.id}`,
|
||||
adminHeaders
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user