add basic repository support

This commit is contained in:
Johannes Zellner
2022-11-09 14:18:04 +01:00
parent e15024f46c
commit 7f37de0dd1
3 changed files with 25 additions and 8 deletions

View File

@@ -3326,10 +3326,13 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
else this._fetchingAppstoreAppsListener.push(callback);
};
Client.prototype.getAppstoreApps = function (callback) {
Client.prototype.getAppstoreApps = function (repository, callback) {
var that = this;
get('/api/v1/appstore/apps', null, function (error, data, status) {
callback = callback || function () {};
repository = repository || 'core';
get('/api/v1/appstore/apps?repository=' + repository, null, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
@@ -3339,10 +3342,12 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
});
};
Client.prototype.getAppstoreAppsFast = function (callback) {
Client.prototype.getAppstoreAppsFast = function (repository, callback) {
if (this._appstoreAppCache.length !== 0) return callback(null, this._appstoreAppCache);
this.getAppstoreApps(callback);
repository = repository || 'core';
this.getAppstoreApps(repository, callback);
};
Client.prototype.getSubscription = function (callback) {