Add enable/disable incoming email domain config

This commit is contained in:
Johannes Zellner
2025-03-10 21:06:33 +01:00
parent 7bec653b55
commit 72635c8711
8 changed files with 184 additions and 17 deletions
+11
View File
@@ -39,6 +39,17 @@ function create() {
if (result.status !== 200) return [result];
return [null, result.body.count];
},
async setEnabled(domain, enabled) {
let result;
try {
result = await fetcher.post(`${API_ORIGIN}/api/v1/mail/${domain}/enable`, { enabled }, { access_token: accessToken });
} catch (e) {
return [e];
}
if (result.status !== 202) return [result];
return [null];
},
async usage(domain) {
let result;
try {