-
Notifications
You must be signed in to change notification settings - Fork 12
Order Implementation of buy #38
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
base: main
Are you sure you want to change the base?
Conversation
|
@varun-suvarna-17 I think we don't need the sell endpoint as it is already implemented in /listing (with type as sell) |
|
Also change the |
|
|
||
| const order = new Order({ | ||
| user, | ||
| type: "buy", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type not needed
| } | ||
| } | ||
|
|
||
| export async function placeSellOrder(req, res) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sell endpoint not needed
| ref: "social-logins", | ||
| required: true, | ||
| }, | ||
| type: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type not needed
| router.post("/buy", placeBuyOrder); | ||
| router.post("/sell", placeSellOrder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these routes are not needed just have a / endpoint for buy
|
|
||
| export async function placeBuyOrder(req, res) { | ||
| try { | ||
| console.log("Received body:", req.body); // 🔍 Debug incoming data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment out debug logs while pushing
So in this problem i have made 3 files
Edited files -- mainRoutes i have included the path /orders thats it
now coming to testing part --