Fix issue with uploading sermon - file was not being moved from tmp folder
parent
9db3033e71
commit
85f0793d91
|
|
@ -109,7 +109,14 @@ 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});
|
||||
renameFile(req.body.tmpPath,req.body.finalPath,function(err){
|
||||
if (err){
|
||||
removeFile(req.body.tmpPath);
|
||||
res.status(500).json({"status":500,"message":"Could not rename the temp file"});
|
||||
} else {
|
||||
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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue