Skip to content
Permalink
Browse files
fixed errors while adding and deleting a comment
  • Loading branch information
watrasm committed Dec 1, 2019
1 parent bab1807 commit c2c4ec33cee45666940ba29a9739a19a0199b58d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
@@ -254,6 +254,8 @@ router.post('/addComment', async ctx => {
try {
const body = ctx.request.body
await comments.comments(ctx.session.user, body.comments, body.genretitle, body.genre)
ctx.body = ""
return;

} catch (err) {
console.log(err)
@@ -264,7 +266,8 @@ router.post('/addComment', async ctx => {
router.post('/deleteComment', async ctx => {
try {
await comments.deleteComments(ctx.request.body.commentID)

ctx.body = ""
return;
} catch (err) {
console.log(err)
await ctx.render('error', { message: err.message })
@@ -9,6 +9,10 @@
"comments": $("#comments").val(),
"genre": $("#genre").val(),
"genretitle": $("#genretitle").val(),
},
complete: function(jqXHR, status) {
//console.log(status);
//console.log(JSON.stringify(jqXHR));
}
});
load_content("content_playlist", "{{genre}}")

0 comments on commit c2c4ec3

Please sign in to comment.