snappymail/dev/Stores/Admin/Domain.js
the-djmaze 0da681f074 OpenPGP.js now stores keys in localStorage
Renamed all deleteAccess to askDelete
2022-01-27 23:07:34 +01:00

25 lines
571 B
JavaScript

import ko from 'ko';
import Remote from 'Remote/Admin/Fetch';
export const DomainAdminStore = ko.observableArray();
DomainAdminStore.loading = ko.observable(false);
DomainAdminStore.fetch = () => {
DomainAdminStore.loading(true);
Remote.request('AdminDomainList',
(iError, data) => {
DomainAdminStore.loading(false);
if (!iError) {
DomainAdminStore(
data.Result.map(item => {
item.disabled = ko.observable(item.disabled);
item.askDelete = ko.observable(false);
return item;
})
);
}
}, {
IncludeAliases: 1
});
};