endpoint workzzz

This commit is contained in:
counterweight 2025-02-28 23:58:51 +01:00
parent 197e90a0f3
commit 9e2af37158
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
2 changed files with 75 additions and 1 deletions

View file

@ -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;