move updater routes and settings under /api/v1/updater

This commit is contained in:
Girish Ramakrishnan
2023-08-03 14:26:41 +05:30
parent db26a6beb9
commit 5603b9e811
14 changed files with 210 additions and 147 deletions

View File

@@ -1236,7 +1236,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
Client.prototype.getUpdateInfo = function (callback) {
if (!this._userInfo.isAtLeastAdmin) return callback(new Error('Not allowed'));
get('/api/v1/cloudron/update', null, function (error, data, status) {
get('/api/v1/updater/updates', null, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
@@ -1245,7 +1245,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
};
Client.prototype.checkForUpdates = function (callback) {
post('/api/v1/cloudron/check_for_updates', {}, null, function (error, data, status) {
post('/api/v1/updater/check_for_updates', {}, null, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
@@ -1263,7 +1263,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
};
Client.prototype.setAutoupdatePattern = function (pattern, callback) {
post('/api/v1/settings/autoupdate_pattern', { pattern: pattern }, null, function (error, data, status) {
post('/api/v1/updater/autoupdate_pattern', { pattern: pattern }, null, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
@@ -1272,7 +1272,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
};
Client.prototype.getAutoupdatePattern = function (callback) {
get('/api/v1/settings/autoupdate_pattern', null, function (error, data, status) {
get('/api/v1/updater/autoupdate_pattern', null, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
@@ -1992,7 +1992,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
skipBackup: !!options.skipBackup
};
post('/api/v1/cloudron/update', data, null, function (error, data, status) {
post('/api/v1/updater/update', data, null, function (error, data, status) {
if (error) return callback(error);
if (status !== 202) return callback(new ClientError(status, data));