Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extending product entity #121

Closed
jannahalka opened this issue Aug 20, 2022 · 5 comments
Closed

Extending product entity #121

jannahalka opened this issue Aug 20, 2022 · 5 comments

Comments

@jannahalka
Copy link

Hi, I have a question about extension of Product entity. I extended the product entity with one more field I checked the database and the field was successfully added. My question is how can I access the extended product service? I defined custom route where I tried to use productService through the scope but I didn't see my extended column. Can you help me with that? thanks in advance

@adrien2p
Copy link
Owner

adrien2p commented Aug 20, 2022

If you did not create an a product service that extend the existing one then there is no extended product service. Could you tell me a bit more about that custom end point and what it is for? So that i can provide you with the best approach depending on your answer

@jannahalka
Copy link
Author

Hello, I am trying to extend the current product Entity. I am using typescript and when I try to use extended product in req.scope.create I don't see the newly created column

@adrien2p
Copy link
Owner

adrien2p commented Aug 23, 2022

You need to extend the validator AdminPostProductsReq to accept your property, so that when you send the payload you can send that value to to be added during the product creation.

It means that once you have extended the entity, you only need to extend the validator and you can then use the existing routes

@jannahalka
Copy link
Author

Thanks, will try it. One more question if I have any other question can I contact you somewhere else besides here? Thanks again

@adrien2p
Copy link
Owner

Yes, you can ask them on discord as well. Other persons are using the extender and i am a core member of medusa too 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants