Skip to content
Snippets Groups Projects
Commit 5af84c0e authored by Vassilios Ioannidis's avatar Vassilios Ioannidis
Browse files

fixed sqlite3 news_id -1 issue

parent 854db6b2
Branches vava
No related tags found
1 merge request!1fixed sqlite3 news_id -1 issue
......@@ -49,10 +49,14 @@
function submitNews(){
vm.info.project_id = (vm.info.restricted == 'Y') ? Authentication.currentUser.project_id : null;
delete vm.info['restricted'];
if(vm.info.news_id == -1) News.news.post(vm.info).then(function(){
if(vm.info.news_id == -1) {
//delete the news_id value of -1 as it breaks sqlite3 db
delete vm.info['news_id'];
News.news.post(vm.info).then(function(){
toastr.success('News created successfuly','success');
$location.path("/news");
});
}
else vm.info.save().then(function(){
toastr.success('News updated successfuly','success');
$location.path("/news");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment