When adding a domain, you can also add a custom email address.
This commit is contained in:
26
ui/src/repository/settings.ts
Normal file
26
ui/src/repository/settings.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { Setting } from "@/domain/settings";
|
||||
import { getPb } from "./api";
|
||||
|
||||
export const getEmails = async () => {
|
||||
try {
|
||||
const resp = await getPb()
|
||||
.collection("settings")
|
||||
.getFirstListItem<Setting>("name='emails'");
|
||||
return resp;
|
||||
} catch (e) {
|
||||
return {
|
||||
content: { emails: [] },
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export const update = async (setting: Setting) => {
|
||||
const pb = getPb();
|
||||
let resp: Setting;
|
||||
if (setting.id) {
|
||||
resp = await pb.collection("settings").update(setting.id, setting);
|
||||
} else {
|
||||
resp = await pb.collection("settings").create(setting);
|
||||
}
|
||||
return resp;
|
||||
};
|
||||
Reference in New Issue
Block a user