Browse Source

🐛 fix(areas): 修复区域创建成功判断条件错误

- 将创建区域成功的状态码判断从200修正为201,符合HTTP标准中资源创建成功的状态码定义
yourname 9 months ago
parent
commit
d8f29244f9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/client/admin/pages/Areas.tsx

+ 1 - 1
src/client/admin/pages/Areas.tsx

@@ -86,7 +86,7 @@ const Areas: React.FC = () => {
   const createArea = useMutation({
   const createArea = useMutation({
     mutationFn: async (data: any) => {
     mutationFn: async (data: any) => {
       const res = await areaClient.$post({ json: data as any });
       const res = await areaClient.$post({ json: data as any });
-      if (res.status !== 200) {
+      if (res.status !== 201) {
         throw new Error('创建区域失败');
         throw new Error('创建区域失败');
       }
       }
       return res.json();
       return res.json();