diff --git a/src/js/client.js b/src/js/client.js
index 44847afcf..e76bf8c27 100644
--- a/src/js/client.js
+++ b/src/js/client.js
@@ -398,8 +398,8 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
});
};
- Client.prototype.restoreApp = function (appId, backupId, password, callback) {
- var data = { password: password, backupId: backupId };
+ Client.prototype.restoreApp = function (appId, backupId, callback) {
+ var data = { backupId: backupId };
post('/api/v1/apps/' + appId + '/restore', data, null, function (error, data, status) {
if (error) return callback(error);
@@ -420,8 +420,8 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
});
};
- Client.prototype.uninstallApp = function (appId, password, callback) {
- var data = { password: password };
+ Client.prototype.uninstallApp = function (appId, callback) {
+ var data = {};
post('/api/v1/apps/' + appId + '/uninstall', data, null, function (error, data, status) {
if (error) return callback(error);
diff --git a/src/views/apps.html b/src/views/apps.html
index 0e916790a..dd6b92060 100644
--- a/src/views/apps.html
+++ b/src/views/apps.html
@@ -256,16 +256,6 @@
-
@@ -334,7 +324,7 @@
@@ -431,34 +421,20 @@
-
-
-
-
-
Deleting the app will also remove all it's data!
-
-
-
-
+
+
+
+
+
Deleting the app will also remove all it's data!
+
+
+
diff --git a/src/views/apps.js b/src/views/apps.js
index dccaf6d6d..4aec20359 100644
--- a/src/views/apps.js
+++ b/src/views/apps.js
@@ -239,8 +239,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
$scope.appUninstall = {
busy: false,
error: {},
- app: {},
- password: ''
+ app: {}
};
$scope.appRestore = {
@@ -248,7 +247,6 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
busyFetching: false,
error: {},
app: {},
- password: '',
backups: [ ],
selectedBackup: null,
@@ -370,14 +368,9 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
restore: function () {
$scope.appRestore.busy = true;
- $scope.appRestore.error.password = null;
- Client.restoreApp($scope.appRestore.app.id, $scope.appRestore.selectedBackup.id, $scope.appRestore.password, function (error) {
- if (error && error.statusCode === 403) {
- $scope.appRestore.password = '';
- $scope.appRestore.error.password = true;
- $('#appRestorePasswordInput').focus();
- } else if (error) {
+ Client.restoreApp($scope.appRestore.app.id, $scope.appRestore.selectedBackup.id, function (error) {
+ if (error) {
Client.error(error);
} else {
$('#appRestoreModal').modal('hide');
@@ -471,10 +464,6 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
// reset uninstall dialog
$scope.appUninstall.app = {};
$scope.appUninstall.error = {};
- $scope.appUninstall.password = '';
-
- $scope.appUninstallForm.$setPristine();
- $scope.appUninstallForm.$setUntouched();
// reset update dialog
$scope.appUpdate.error = {};
@@ -484,7 +473,6 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
// reset restore dialog
$scope.appRestore.error = {};
$scope.appRestore.app = {};
- $scope.appRestore.password = '';
$scope.appRestore.selectedBackup = null;
$scope.appRestore.backups = [];
$scope.appRestore.location = '';
@@ -559,15 +547,9 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
$scope.doUninstall = function () {
$scope.appUninstall.busy = true;
- $scope.appUninstall.error.password = null;
- Client.uninstallApp($scope.appUninstall.app.id, $scope.appUninstall.password, function (error) {
- if (error && error.statusCode === 403) {
- $scope.appUninstall.password = '';
- $scope.appUninstall.error.password = true;
- $scope.appUninstallForm.password.$setPristine();
- $('#appUninstallPasswordInput').focus();
- } else if (error && error.statusCode === 402) { // unpurchase failed
+ Client.uninstallApp($scope.appUninstall.app.id, function (error) {
+ if (error && error.statusCode === 402) { // unpurchase failed
Client.error('Relogin to Cloudron App Store');
} else if (error) {
Client.error(error);