-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Issue with Override createFromCart of OrderService. #4151
Comments
I'm also somewhat desperately trying to do exactly the same thing - attach a store ID to an order during the cart completion process. With this code I get a stack overflow: ` async createFromCart(cartOrId: string | Cart): Promise<Order | never> {
} |
Hey @NitishGameChanges - I just saw this in the "marketplace" article on the MedusaJS blog under 'Next Steps': Associate an order to a store: This requires listening to the I think the supported approach for that kind of multi-tenancy with orders is going to be the subscriber. Trying that next. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 3 days. |
This issue was closed because it has been stalled for 3 days with no activity. |
Bug report
Describe the bug
The issue with Override createFromCart of OrderService.
Code - `async createFromCart(cartOrId: string | Cart): Promise<Order | never> {
return await this.atomicPhase_(async (manager) => {
let order = await super.withTransaction(manager).createFromCart(cartOrId);
A clear and concise description of what the bug is.
Bug / error :
<html>TS2345: Argument of type 'Repository<Order> & { target: EntityTarget<Order> & typeof Order; manager: EntityManager; queryRunner?: QueryRunner; findWithRelations(relations?: FindOptionsRelations<...>, optionsWithoutRelations?: Omit<...>): Promise<...>; findOneWithRelations(relations?: FindOptionsRelations<...>, optionsWithoutRelations?: Omit<...' is not assignable to parameter of type 'Repository<any> & Repository<ObjectLiteral>'.<br/>Type 'Repository<Order> & { target: EntityTarget<Order> & typeof Order; manager: EntityManager; queryRunner?: QueryRunner; findWithRelations(relations?: FindOptionsRelations<...>, optionsWithoutRelations?: Omit<...>): Promise<...>; findOneWithRelations(relations?: FindOptionsRelations<...>, optionsWithoutRelations?: Omit<...' is missing the following properties from type 'Repository<any>': sum, average, minimum, maximum
System information
Medusa version (including plugins):
Node.js version: v16.19.0
Database: Postgres
Operating system: MacOS
Browser (if relevant):
Steps to reproduce the behavior
Expected behavior
I want line
const orderRepo = manager.withRepository(this.container.orderRepository)
to work.Screenshots
If applicable, add screenshots to help explain your problem
Code snippets
If applicable, add code samples to help explain your problem
Additional context
Add any other context about the problem here
The text was updated successfully, but these errors were encountered: