|
|
@ -1,3 +1,5 @@ |
|
|
|
|
|
|
|
import { asyncAwesomeAlert } from "../../utils/AsyncWrappers"; |
|
|
|
|
|
|
|
|
|
|
|
const initialState = { |
|
|
|
const initialState = { |
|
|
|
loading: false, |
|
|
|
loading: false, |
|
|
|
error: null, |
|
|
|
error: null, |
|
|
@ -12,6 +14,10 @@ export default function comment(state = initialState, action) { |
|
|
|
case "comment/update": |
|
|
|
case "comment/update": |
|
|
|
return { ...state, loading: false, error: null }; |
|
|
|
return { ...state, loading: false, error: null }; |
|
|
|
case "comment/add": |
|
|
|
case "comment/add": |
|
|
|
|
|
|
|
asyncAwesomeAlert("نتیجه", "کامنت شما با موفقیت ثبت شد.", { |
|
|
|
|
|
|
|
confirmText: "باشه", |
|
|
|
|
|
|
|
showCancelButton: false, |
|
|
|
|
|
|
|
}); |
|
|
|
return { ...state, loading: false, error: null }; |
|
|
|
return { ...state, loading: false, error: null }; |
|
|
|
case "comment/delete": |
|
|
|
case "comment/delete": |
|
|
|
return { ...state, loading: false, error: null }; |
|
|
|
return { ...state, loading: false, error: null }; |
|
|
@ -27,8 +33,7 @@ export default function comment(state = initialState, action) { |
|
|
|
case "comment/error": |
|
|
|
case "comment/error": |
|
|
|
asyncAwesomeAlert("خطا", data.message, { |
|
|
|
asyncAwesomeAlert("خطا", data.message, { |
|
|
|
showCancelButton: false, |
|
|
|
showCancelButton: false, |
|
|
|
confirmText: "باشه" |
|
|
|
confirmText: "باشه", |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
return { ...state, loading: false, error: data.message }; |
|
|
|
return { ...state, loading: false, error: data.message }; |
|
|
|
default: |
|
|
|
default: |
|
|
|