Last active
April 10, 2020 02:32
-
-
Save routonmh/790bda571251f7df8289131a857c7e36 to your computer and use it in GitHub Desktop.
Node.js vsASP .NET Core
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
[HttpPost("submit-comment")] | |
public async Task<ActionResult> SubmitComment([Required, FromBody] CommentSubmission submission) | |
{ | |
if (await Model.AddCommentSubmission(submission)) | |
return new OkResult(); | |
return new BadRequestResult(); | |
} | |
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
Router.post('/submit-comment', async (req, res) => { | |
let success = await Model.addComment(req.body); | |
if (success) | |
res.sendStatus(200); | |
res.sendStatus(400); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment