feat: Add shipping method to cart (#6661)
This commit is contained in:
1 parent
c3c4f49fc2
commit
f0c8142635
18 files changed
+491
-23
No files matched your search
@@ -1,13 +1,13 @@
|
||||
import { moduleProviderLoader } from "@medusajs/modules-sdk"
|
||||
import { LoaderOptions, ModuleProvider, ModulesSdkTypes } from "@medusajs/types"
|
||||
import { asFunction, asValue, Lifetime } from "awilix"
|
||||
import { FulfillmentIdentifiersRegistrationName } from "@types"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
lowerCaseFirst,
|
||||
promiseAll,
|
||||
} from "@medusajs/utils"
|
||||
import { FulfillmentProviderService } from "@services"
|
||||
import { FulfillmentIdentifiersRegistrationName } from "@types"
|
||||
import { Lifetime, asFunction, asValue } from "awilix"
|
||||
|
||||
const registrationFn = async (klass, container, pluginOptions) => {
|
||||
Object.entries(pluginOptions.config || []).map(([name, config]) => {
|
||||
|
||||
@@ -25,7 +25,6 @@ import {
|
||||
promiseAll,
|
||||
} from "@medusajs/utils"
|
||||
|
||||
import { entityNameToLinkableKeysMap, joinerConfig } from "../joiner-config"
|
||||
import {
|
||||
Fulfillment,
|
||||
FulfillmentSet,
|
||||
@@ -37,6 +36,7 @@ import {
|
||||
ShippingProfile,
|
||||
} from "@models"
|
||||
import { isContextValid, validateRules } from "@utils"
|
||||
import { entityNameToLinkableKeysMap, joinerConfig } from "../joiner-config"
|
||||
import FulfillmentProviderService from "./fulfillment-provider"
|
||||
|
||||
const generateMethodForModels = [
|
||||
@@ -435,7 +435,7 @@ export default class FulfillmentModuleService<
|
||||
return []
|
||||
}
|
||||
|
||||
const rules = data_.flatMap((d) => d.rules)
|
||||
const rules = data_.flatMap((d) => d.rules).filter(Boolean)
|
||||
if (rules.length) {
|
||||
validateRules(rules as Record<string, unknown>[])
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user