adrien2p / medusa-extender

:syringe: Medusa on steroid, take your medusa project to the next level with some badass features :rocket:
https://adrien2p.github.io/medusa-extender/
MIT License
320 stars 40 forks source link

[BUG] Multitenancy Config | Tenant Code Resolver #168

Closed oakbani closed 1 year ago

oakbani commented 1 year ago

There are multiple issues with the tenant code resolver as given in the multi tenancy config docs in medusa extender.

image
  1. medusa-config is a js file with doesn't accept type annotations ( req: MedusaRequest)
  2. If you pass on a simple method here, medusa-extender keeps throwing this error

Tenant Code Resolver is not a function

Even tried with exactly how you have used in your unit test. multi_tenancy: { enable: true, tenant_code_resolver: (req) => req.headers['x-tenant'],

adrien2p commented 1 year ago

Thanks for the reporting, it should be fixed by https://github.com/adrien2p/medusa-extender/pull/169

adrien2p commented 1 year ago

Fixed in the next release. I ll be away fir a week

oakbani commented 1 year ago

Thanks man!