Browse Source

feat(dev-server): Tidy up multivendor plugin example

Michael Bromley 3 years ago
parent
commit
19aa3a0424

+ 3 - 0
packages/core/src/service/helpers/order-splitter/order-splitter.ts

@@ -82,7 +82,10 @@ export class OrderSplitter {
                     'taxCategory',
                     'featuredAsset',
                     'shippingLine',
+                    'shippingLineId',
                     'customFields',
+                    'sellerChannel',
+                    'sellerChannelId',
                 ]),
                 items: [],
             }),

+ 1 - 0
packages/dev-server/test-plugins/multivendor-plugin/config/mv-shipping-eligibility-checker.ts

@@ -17,6 +17,7 @@ export const multivendorShippingEligibilityChecker = new ShippingEligibilityChec
     },
     check: async (ctx, order, args, method) => {
         await entityHydrator.hydrate(ctx, method, { relations: ['channels'] });
+        await entityHydrator.hydrate(ctx, order, { relations: ['lines.sellerChannel'] });
         const sellerChannel = method.channels.find(c => c.code !== DEFAULT_CHANNEL_CODE);
         if (!sellerChannel) {
             return false;

+ 1 - 1
packages/dev-server/test-plugins/multivendor-plugin/service/mv.service.ts

@@ -123,7 +123,7 @@ export class MultivendorService {
             description: `Administrator of ${input.shopName}`,
             permissions: [
                 Permission.CreateCatalog,
-                Permission.UpdateSeller,
+                Permission.UpdateCatalog,
                 Permission.ReadCatalog,
                 Permission.DeleteCatalog,
                 Permission.CreateOrder,