chore: Move most of the remaining endpoints to zod (#7096)

This commit is contained in:
Stevche Radevski
2024-04-18 14:12:13 +02:00
committed by GitHub
parent 62b9dcc6c1
commit be00a2eb51
31 changed files with 551 additions and 661 deletions

View File

@@ -188,9 +188,9 @@ medusaIntegrationTestRunner({
const { api_key } = apiKeyRes.data
const keyWithChannelsRes = await api.post(
`/admin/api-keys/${api_key.id}/sales-channels/batch/add`,
`/admin/api-keys/${api_key.id}/sales-channels/batch`,
{
sales_channel_ids: [sales_channel.id],
create: [sales_channel.id],
},
adminHeaders
)
@@ -229,9 +229,9 @@ medusaIntegrationTestRunner({
const errorRes = await api
.post(
`/admin/api-keys/${apiKeyRes.data.api_key.id}/sales-channels/batch/add`,
`/admin/api-keys/${apiKeyRes.data.api_key.id}/sales-channels/batch`,
{
sales_channel_ids: [sales_channel.id],
create: [sales_channel.id],
},
adminHeaders
)
@@ -255,9 +255,9 @@ medusaIntegrationTestRunner({
const errorRes = await api
.post(
`/admin/api-keys/${apiKeyRes.data.api_key.id}/sales-channels/batch/add`,
`/admin/api-keys/${apiKeyRes.data.api_key.id}/sales-channels/batch`,
{
sales_channel_ids: ["phony"],
create: ["phony"],
},
adminHeaders
)
@@ -292,9 +292,9 @@ medusaIntegrationTestRunner({
const { api_key } = apiKeyRes.data
const keyWithChannelsRes = await api.post(
`/admin/api-keys/${api_key.id}/sales-channels/batch/add`,
`/admin/api-keys/${api_key.id}/sales-channels/batch`,
{
sales_channel_ids: [sales_channel.id],
create: [sales_channel.id],
},
adminHeaders
)
@@ -311,9 +311,9 @@ medusaIntegrationTestRunner({
])
const keyWithoutChannelsRes = await api.post(
`/admin/api-keys/${api_key.id}/sales-channels/batch/remove`,
`/admin/api-keys/${api_key.id}/sales-channels/batch`,
{
sales_channel_ids: [sales_channel.id],
delete: [sales_channel.id],
},
adminHeaders
)
@@ -348,9 +348,9 @@ medusaIntegrationTestRunner({
const { api_key } = apiKeyRes.data
const keyWithChannelsRes = await api.post(
`/admin/api-keys/${api_key.id}/sales-channels/batch/add`,
`/admin/api-keys/${api_key.id}/sales-channels/batch`,
{
sales_channel_ids: [sales_channel.id],
create: [sales_channel.id],
},
adminHeaders
)