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

@@ -9,7 +9,7 @@ import { useToast } from "@/components/ui/use-toast";
import { getErrMsg } from "@/utils/error";
import { isValidURL } from "@/utils/url";
import { NotifyChannels, NotifyChannelServerChan } 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";
@@ -103,7 +103,7 @@ const ServerChan = () => {
return;
}
const resp = await update({
const resp = await save({
...config,
name: "notifyChannels",
content: {
@@ -167,7 +167,7 @@ const ServerChan = () => {
setServerChan(newData);
try {
const resp = await update({
const resp = await save({
...config,
name: "notifyChannels",
content: {