mirror of
https://github.com/beilunyang/moemail.git
synced 2025-10-10 01:40:52 +08:00
feat: Enhance email domain configuration and management
This commit is contained in:
@@ -17,10 +17,6 @@ interface CreateDialogProps {
|
||||
onEmailCreated: () => void
|
||||
}
|
||||
|
||||
interface DomainResponse {
|
||||
domains: string[]
|
||||
}
|
||||
|
||||
export function CreateDialog({ onEmailCreated }: CreateDialogProps) {
|
||||
const [open, setOpen] = useState(false)
|
||||
const [loading, setLoading] = useState(false)
|
||||
@@ -89,7 +85,7 @@ export function CreateDialog({ onEmailCreated }: CreateDialogProps) {
|
||||
|
||||
const fetchDomains = async () => {
|
||||
const response = await fetch("/api/emails/domains");
|
||||
const data = (await response.json()) as DomainResponse;
|
||||
const data = (await response.json()) as { domains: string[] };
|
||||
setDomains(data.domains || []);
|
||||
setCurrentDomain(data.domains[0] || "");
|
||||
};
|
||||
|
Reference in New Issue
Block a user