Skip to content

Commit

Permalink
fixed js
Browse files Browse the repository at this point in the history
  • Loading branch information
Сергей Владимирович Лавров authored and Сергей Владимирович Лавров committed May 26, 2017
1 parent c5b0385 commit f22ca1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Binary file modified project/db.sqlite3
Binary file not shown.
13 changes: 4 additions & 9 deletions project/static/js/controllers/taskController.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var taskManager = angular.module('taskManager');
taskManager.controller('taskController', function ($scope, $http) {

var loadData = function () {
$http.get('/task/list').then(function success(response) {
$http.get('/task/list').done(function success(response) {
$scope.tasks = response.data;
})}

Expand All @@ -13,21 +13,16 @@ taskManager.controller('taskController', function ($scope, $http) {
$scope.add = function (text) {
if(text != "")
{
$http.post('/task/add', {'text': text})
.then(function () {
return loadData()
})
$http.post('/task/add', {'text': text}).done(loadData)
}
};
$scope.delete = function (task) {
var url = '/task/' + task.id + '/delete'
$http.delete(url).then(function () {
return loadData()
})
$http.delete(url).done(loadData())
};
$scope.edit = function (task, edited_text) {
var url = '/task/' + task.id + '/edit'
$http.patch(url, {'text': edited_text}).then(function () {
$http.patch(url, {'text': edited_text}).done(function () {
$scope.editing = false
return loadData()
})
Expand Down

0 comments on commit f22ca1c

Please sign in to comment.