Browse Source

[FIX] processing server result

Gogs 7 năm trước cách đây
mục cha
commit
b1a3e738b7
1 tập tin đã thay đổi với 2 bổ sung11 xóa
  1. 2 11
      src/store/actions.js

+ 2 - 11
src/store/actions.js

@@ -168,22 +168,13 @@ const actions = {
         }
 
         return axios.post(PROCESS_SALE_URL, data).then(response => {
-            console.log(response)
-
-            commit(SET_PROCESSING, false)
-            dispatch(COMPLETE_SALE, true)
+            commit(SET_PROCESSING, !response.data.result)
+            dispatch(COMPLETE_SALE, response.data.result)
         }).catch(error => {
             console.log(error)
 
             commit(SET_PROCESSING, false)
         })
-
-        // commit(SET_PROCESSING, true)
-
-        // setTimeout(() => {
-        //     commit(SET_PROCESSING, false)
-        //     dispatch(COMPLETE_SALE, true)
-        // }, 2000)
     },
     /**
      *