Add image name edition

This commit is contained in:
Loic GUEGAN 2016-05-08 15:49:21 +02:00
parent c5e909da1b
commit 19d62a8cbf
3 changed files with 25 additions and 13 deletions

View file

@ -63,11 +63,15 @@ mainApp.factory('Image', ['$http', 'Identity', function ($http, Identity) {
* @returns {undefined}
*/
var updateImage = function (image, callback) {
console.log(image)
var result = $http.post('../server/index.php',
$.param({"token": Identity.getToken(), "task": "image", 'action': 'updateImage', 'id': image.id, 'opt': image}));
$.param({"token": Identity.getToken(), "task": "image", 'action': 'updateImage', 'id': image.id, 'opt': {'name': image.name}}));
// Wait and handle the response
result.then(function (response) {
console.log(response.data.Images)
callback();
}, function (response) {
alert(response);