Change filepath to sermon storage
parent
e062d15c15
commit
9db3033e71
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue