refactor(errors): migrate decisions to {code,msg}

This commit is contained in:
zetaloop
2026-02-28 07:21:51 +08:00
parent 4e2ee5be54
commit cc24a0cbc3
23 changed files with 157 additions and 165 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import { allow, deny } from "@/lib/policy/assert"
import { allow, deny } from "@/lib/decision"
import type { Notification } from "@/lib/types"
import { useAuthStore } from "@/store/auth"
import { useNotificationStore } from "@/store/notifications"
@@ -21,7 +21,7 @@ export function addNotification(input: {
link?: string
}) {
if (!isNotificationEnabled(input.type)) {
return deny("IDEMPOTENT_NOOP", "该类通知已关闭")
return deny(400, "该类通知已关闭")
}
useNotificationStore.getState().addNotification(input)