initial create-swap with sales channel (#3998)
This commit is contained in:
@@ -18,9 +18,9 @@ import {
|
||||
} from "class-validator"
|
||||
|
||||
import { EntityManager } from "typeorm"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
import { MedusaError } from "medusa-core-utils"
|
||||
import { Type } from "class-transformer"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
|
||||
/**
|
||||
@@ -171,7 +171,9 @@ export default async (req, res) => {
|
||||
|
||||
await swapService
|
||||
.withTransaction(manager)
|
||||
.createCart(swap.id, validated.custom_shipping_options)
|
||||
.createCart(swap.id, validated.custom_shipping_options, {
|
||||
sales_channel_id: validated.sales_channel_id,
|
||||
})
|
||||
|
||||
const returnOrder = await returnService
|
||||
.withTransaction(manager)
|
||||
@@ -349,6 +351,10 @@ export class AdminPostOrdersOrderSwapsReq {
|
||||
@Type(() => ReturnShipping)
|
||||
return_shipping?: ReturnShipping
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
sales_channel_id?: string
|
||||
|
||||
@IsArray()
|
||||
@IsOptional()
|
||||
@ValidateNested({ each: true })
|
||||
|
||||
@@ -9,13 +9,13 @@ import {
|
||||
} from "class-validator"
|
||||
import { defaultStoreSwapFields, defaultStoreSwapRelations } from "."
|
||||
|
||||
import { Type } from "class-transformer"
|
||||
import { MedusaError } from "medusa-core-utils"
|
||||
import { EntityManager } from "typeorm"
|
||||
import IdempotencyKeyService from "../../../../services/idempotency-key"
|
||||
import { MedusaError } from "medusa-core-utils"
|
||||
import OrderService from "../../../../services/order"
|
||||
import ReturnService from "../../../../services/return"
|
||||
import SwapService from "../../../../services/swap"
|
||||
import { Type } from "class-transformer"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user