This repository has been archived by the owner on Mar 22, 2023. It is now read-only.
forked from Uniswap/v2-subgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
endpoint made for removeLiquidityCSPR and removereserves event check …
…updated
- Loading branch information
1 parent
9a00a8f
commit 0343ce1
Showing
5 changed files
with
54 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
require("dotenv").config(); | ||
var express = require("express"); | ||
var router = express.Router(); | ||
var RemoveReservesDataModel = require("../models/removeReservesData"); | ||
|
||
router | ||
.route("/setUserForRemoveLiquidityCSPR") | ||
.post(async function (req, res, next) { | ||
try { | ||
if (!req.body.user) { | ||
return res.status(400).json({ | ||
success: false, | ||
message: "user did not found in the request body.", | ||
}); | ||
} | ||
if (!req.body.deployHash) { | ||
return res.status(400).json({ | ||
success: false, | ||
message: "deployHash did not found in the request body." | ||
}); | ||
} | ||
let newData = new RemoveReservesDataModel({ | ||
user: req.body.user, | ||
deployHash: req.body.deployHash, | ||
}); | ||
await RemoveReservesDataModel.create(newData); | ||
return res.status(200).json({ | ||
success: true, | ||
message: "User successfully stored for removed liquidity CSPR." | ||
}); | ||
} catch (error) { | ||
console.log("error (try-catch) : " + error); | ||
return res.status(500).json({ | ||
success: false, | ||
err: error, | ||
}); | ||
} | ||
}); | ||
|
||
module.exports = router; |