Created
September 28, 2021 06:42
-
-
Save hieptl/8ed9128dbe1cdf691bfe78a9053427c0 to your computer and use it in GitHub Desktop.
requests.js - API - Get the List of Matching Requests - Tinder Clone
This file contains hidden or 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
app.post("/requests/get", (req, res) => { | |
const { ccUid } = req.body; | |
const sql = "SELECT * FROM match_request WHERE match_request_from = ? || match_request_to = ?"; | |
dbConn.query(sql, [ccUid, ccUid], function (err, result) { | |
if (err) { | |
res.status(200).jsonp({ message: 'Cannot get the list of match requests' }); | |
} else { | |
res.status(200).jsonp(result); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment