fix: tests
This commit is contained in:
@@ -81,12 +81,14 @@ export default async (req, res) => {
|
||||
.optional(),
|
||||
})
|
||||
.optional(),
|
||||
rma_shipping_options: Validator.array().items({
|
||||
option_id: Validator.string().optional(),
|
||||
price: Validator.number()
|
||||
.integer()
|
||||
.optional(),
|
||||
}),
|
||||
rma_shipping_options: Validator.array()
|
||||
.items({
|
||||
option_id: Validator.string().optional(),
|
||||
price: Validator.number()
|
||||
.integer()
|
||||
.optional(),
|
||||
})
|
||||
.default([]),
|
||||
additional_items: Validator.array().items({
|
||||
variant_id: Validator.string().required(),
|
||||
quantity: Validator.number().required(),
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import _ from "lodash"
|
||||
import { Validator, MedusaError } from "medusa-core-utils"
|
||||
import { defaultFields, defaultRelations } from "./"
|
||||
import { CartType } from "../../../../models/cart"
|
||||
|
||||
/**
|
||||
* @oas [post] /carts/{id}/shipping-methods
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Validator, MedusaError } from "medusa-core-utils"
|
||||
import { CartType } from "../../../../models/cart"
|
||||
|
||||
/**
|
||||
* @oas [get] /shipping-options/{cart_id}
|
||||
@@ -42,7 +41,7 @@ export default async (req, res) => {
|
||||
})
|
||||
|
||||
let options
|
||||
if (cart.type === CartType.SWAP || cart.type === CartType.CLAIM) {
|
||||
if (cart.type === "swap" || cart.type === "claim") {
|
||||
options = await shippingProfileService.fetchRMAOptions(cart)
|
||||
} else {
|
||||
options = await shippingProfileService.fetchCartOptions(cart)
|
||||
|
||||
@@ -108,7 +108,7 @@ export default async (req, res) => {
|
||||
case "started": {
|
||||
const { key, error } = await idempotencyKeyService.workStage(
|
||||
idempotencyKey.idempotency_key,
|
||||
async (manager) => {
|
||||
async manager => {
|
||||
const order = await orderService
|
||||
.withTransaction(manager)
|
||||
.retrieve(value.order_id, {
|
||||
@@ -130,6 +130,7 @@ export default async (req, res) => {
|
||||
value.return_items,
|
||||
value.additional_items,
|
||||
returnShipping,
|
||||
[],
|
||||
{
|
||||
idempotency_key: idempotencyKey.idempotency_key,
|
||||
no_notification: true,
|
||||
@@ -163,7 +164,7 @@ export default async (req, res) => {
|
||||
case "swap_created": {
|
||||
const { key, error } = await idempotencyKeyService.workStage(
|
||||
idempotencyKey.idempotency_key,
|
||||
async (manager) => {
|
||||
async manager => {
|
||||
const swaps = await swapService.list({
|
||||
idempotency_key: idempotencyKey.idempotency_key,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user