dmail section sidebar

This commit is contained in:
hamid zarghami
2026-04-09 12:57:20 +03:30
parent 331b575908
commit 3539d3adec
8 changed files with 88 additions and 4 deletions
+9
View File
@@ -0,0 +1,9 @@
import { type FC } from 'react'
const Domains: FC = () => {
return (
<div>Domains</div>
)
}
export default Domains
+15
View File
@@ -0,0 +1,15 @@
import { useMutation, useQuery } from "@tanstack/react-query";
import * as api from "../service/DmailService";
export const useGetDomains = () => {
return useQuery({
queryKey: ["dmail-domains"],
queryFn: api.getDomains,
});
};
export const useActiveDomain = () => {
return useMutation({
mutationFn: api.activeDomain,
});
};
+12
View File
@@ -0,0 +1,12 @@
import axios from "../../../config/axios";
import { ActiveDomainType } from "../types/Types";
export const getDomains = async () => {
const { data } = await axios.get(`/dmail`);
return data;
};
export const activeDomain = async (params: ActiveDomainType) => {
const { data } = await axios.patch(`/dmail/${params.id}/active`, params);
return data;
};
+4
View File
@@ -0,0 +1,4 @@
export type ActiveDomainType = {
isActive: boolean;
id: string;
};