refactor(errors): migrate decisions to {code,msg}
This commit is contained in:
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { deny } from "@/lib/policy/assert"
|
||||
import { deny } from "@/lib/decision"
|
||||
import { useAuthStore } from "@/store/auth"
|
||||
import { useReviewStore } from "@/store/reviews"
|
||||
|
||||
@@ -17,7 +17,7 @@ export function listReviewsByTargetUser(userId: string) {
|
||||
export function submitReview(input: { orderId: string; rating: number; content?: string }) {
|
||||
const userId = useAuthStore.getState().user?.id
|
||||
if (!userId) {
|
||||
return deny("AUTH_REQUIRED", "请先登录")
|
||||
return deny(401, "请先登录")
|
||||
}
|
||||
|
||||
return useReviewStore.getState().submitReview({
|
||||
|
||||
Reference in New Issue
Block a user