Skip to content

Commit

Permalink
getSeller
Browse files Browse the repository at this point in the history
  • Loading branch information
talafarael committed May 5, 2024
1 parent 0d32140 commit 851ab00
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Router/authLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,23 @@ const {token}=req.body
console.log(e)
res.status(400).json({message: "Registration error"})
}

}
async getSeller(req,res){
try {
const {sellerID}=req.body
const user=User.findOne({_id:sellerID})
const info={
name:user.name,
avatar:user.avatar,
ownAuction:user.ownAuction
}
return info
} catch (e) {
console.log(e)
res.status(400).json({message: "Registration error"})
}

}
async getUser(req, res) {
try {
Expand Down
2 changes: 2 additions & 0 deletions src/authRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ router.post('/registercreate',controllerLogin.registerCreate)
router.get('/sendemail',controllerLogin.SendEmail)
router.post('/editprofileimage',type,controllerLogin.editprofileimage)
router.post('/validatetoken',controllerLogin.validateToken)
router.post('/getseller',middlewareUser,controllerLogin.getSeller)

//aukction
router.get('/getauction',auctionController.getAuction)

Expand Down

0 comments on commit 851ab00

Please sign in to comment.