diff --git a/Server/src/routes/api/sermons.js b/Server/src/routes/api/sermons.js index 5e66174..505bb1a 100644 --- a/Server/src/routes/api/sermons.js +++ b/Server/src/routes/api/sermons.js @@ -109,6 +109,7 @@ router.post("/a/", function(req,res){ res.status(404).json({"status":404,"message":"Sermon does not exist"}); return; } + res.status(201).json({"status":201,"sermon":sermon}); /////****************************** /////Add the sermon to the postgres db for the existing site // var pg = require("../database/postgres-for-old-db/addSermon"); @@ -156,6 +157,11 @@ router.delete("/a/",function(req,res){ return; } if (result.affectedRows > 0){ + var cPath = storage + filenameFromPath(result.sermon.file); + var dPath = deletedStorage + filenameFromPath(result.sermon.file); + renameFile(cPath,dPath,function(error){ + res.status(200).json({"status":200,"affectedRows":result.affectedRows}); + }); /////****************************** /////Add the sermon to the postgres db for the existing site // var pg = require("../database/postgres-for-old-db/addSermon");