endpoint workzzz
This commit is contained in:
parent
197e90a0f3
commit
9e2af37158
2 changed files with 75 additions and 1 deletions
|
|
@ -234,4 +234,31 @@ router.post(
|
|||
}
|
||||
);
|
||||
|
||||
router.get(
|
||||
'/publickey-offers',
|
||||
rejectIfNotAuthorizedMiddleware,
|
||||
attachPublicKeyMiddleware,
|
||||
async (req, res) => {
|
||||
console.log('elo');
|
||||
const publicKey = req.cookies.publicKey;
|
||||
|
||||
const offers = await offerService.getOffersByPublicKey(publicKey);
|
||||
|
||||
if (!offers) {
|
||||
return res.status(404).json({
|
||||
success: true,
|
||||
message: 'No offers posted by this public key.',
|
||||
});
|
||||
}
|
||||
|
||||
if (offers) {
|
||||
return res.status(200).json({
|
||||
success: true,
|
||||
message: 'Offers found',
|
||||
data: offers,
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = router;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue