refactor(ui): refactor emails state using zustand store

This commit is contained in:
Fu Diwei
2024-12-11 16:42:23 +08:00
parent 83ba3d4450
commit b744363736
21 changed files with 141 additions and 166 deletions

View File

@@ -8,7 +8,7 @@ import { Switch } from "@/components/ui/switch";
import { useToast } from "@/components/ui/use-toast";
import { getErrMsg } from "@/utils/error";
import { NotifyChannels, NotifyChannelTelegram } from "@/domain/settings";
import { update } from "@/repository/settings";
import { save } from "@/repository/settings";
import { useNotifyContext } from "@/providers/notify";
import { notifyTest } from "@/api/notify";
import Show from "@/components/Show";
@@ -96,7 +96,7 @@ const Telegram = () => {
const handleSaveClick = async () => {
try {
const resp = await update({
const resp = await save({
...config,
name: "notifyChannels",
content: {
@@ -160,7 +160,7 @@ const Telegram = () => {
setTelegram(newData);
try {
const resp = await update({
const resp = await save({
...config,
name: "notifyChannels",
content: {