feat(medusa): Remove require id from update shipping options validator (#7166)
* feat(medusa): Remove require id from update shipping options validator * update type apply * Create great-stingrays-clap.md
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
AdminShippingOptionDeleteResponse,
|
||||
AdminShippingOptionRetrieveResponse,
|
||||
FulfillmentWorkflow,
|
||||
} from "@medusajs/types"
|
||||
import { AdminUpdateShippingOptionType } from "../validators"
|
||||
import {
|
||||
@@ -21,8 +22,14 @@ export const POST = async (
|
||||
|
||||
const workflow = updateShippingOptionsWorkflow(req.scope)
|
||||
|
||||
const workflowInput: FulfillmentWorkflow.UpdateShippingOptionsWorkflowInput =
|
||||
{
|
||||
id: req.params.id,
|
||||
...shippingOptionPayload,
|
||||
}
|
||||
|
||||
const { result, errors } = await workflow.run({
|
||||
input: [shippingOptionPayload],
|
||||
input: [workflowInput],
|
||||
throwOnError: false,
|
||||
})
|
||||
|
||||
|
||||
@@ -116,7 +116,6 @@ export type AdminUpdateShippingOptionType = z.infer<
|
||||
>
|
||||
export const AdminUpdateShippingOption = z
|
||||
.object({
|
||||
id: z.string(),
|
||||
name: z.string().optional(),
|
||||
data: z.record(z.unknown()).optional(),
|
||||
price_type: z.nativeEnum(ShippingOptionPriceTypeEnum).optional(),
|
||||
|
||||
Reference in New Issue
Block a user