From fe9d9996fabf9cd340c626c32960111039ba472d Mon Sep 17 00:00:00 2001 From: minuk926 Date: Mon, 30 May 2022 15:12:01 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=99=94=EB=A9=B4=20=EC=A0=95=EB=A6=AC?= =?UTF-8?q?=20=20=20=20=20=20=EB=AF=B8=EC=82=AC=EC=9A=A9=20=EC=86=8C?= =?UTF-8?q?=EC=8A=A4=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/slices/pboard.js | 132 ++++++++++++++++++------------------- 1 file changed, 64 insertions(+), 68 deletions(-) diff --git a/src/store/slices/pboard.js b/src/store/slices/pboard.js index b26a998..bc357e1 100644 --- a/src/store/slices/pboard.js +++ b/src/store/slices/pboard.js @@ -8,11 +8,7 @@ import { dispatch } from '../index'; // ---------------------------------------------------------------------- const initialState = { - error: null, - customers: [], - orders: [], - products: [], - productreviews: [] + error: null }; const slice = createSlice({ @@ -22,27 +18,27 @@ const slice = createSlice({ // HAS ERROR hasError(state, action) { state.error = action.payload; - }, - - // GET CUSTOMERS - getCustomersSuccess(state, action) { - state.customers = action.payload; - }, - - // GET ORDERS - getOrdersSuccess(state, action) { - state.orders = action.payload; - }, - - // GET PRODUCTS - getProductsSuccess(state, action) { - state.products = action.payload; - }, - - // GET PRODUCT REVIEWS - getProductReviewsSuccess(state, action) { - state.productreviews = action.payload; } + + // // GET CUSTOMERS + // getCustomersSuccess(state, action) { + // state.customers = action.payload; + // }, + // + // // GET ORDERS + // getOrdersSuccess(state, action) { + // state.orders = action.payload; + // }, + // + // // GET PRODUCTS + // getProductsSuccess(state, action) { + // state.products = action.payload; + // }, + // + // // GET PRODUCT REVIEWS + // getProductReviewsSuccess(state, action) { + // state.productreviews = action.payload; + // } } }); @@ -51,46 +47,46 @@ export default slice.reducer; // ---------------------------------------------------------------------- -export function getCustomers() { - return async () => { - try { - const response = await axios.get('/api/customer/list'); - dispatch(slice.actions.getCustomersSuccess(response.data.customers)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function getOrders() { - return async () => { - try { - const response = await axios.get('/api/customer/order/list'); - dispatch(slice.actions.getOrdersSuccess(response.data.orders)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function getProducts() { - return async () => { - try { - const response = await axios.get('/api/customer/product/list'); - dispatch(slice.actions.getProductsSuccess(response.data.products)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function getProductReviews() { - return async () => { - try { - const response = await axios.get('/api/customer/product/reviews'); - dispatch(slice.actions.getProductReviewsSuccess(response.data.productreviews)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} +// export function getCustomers() { +// return async () => { +// try { +// const response = await axios.get('/api/customer/list'); +// dispatch(slice.actions.getCustomersSuccess(response.data.customers)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function getOrders() { +// return async () => { +// try { +// const response = await axios.get('/api/customer/order/list'); +// dispatch(slice.actions.getOrdersSuccess(response.data.orders)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function getProducts() { +// return async () => { +// try { +// const response = await axios.get('/api/customer/product/list'); +// dispatch(slice.actions.getProductsSuccess(response.data.products)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function getProductReviews() { +// return async () => { +// try { +// const response = await axios.get('/api/customer/product/reviews'); +// dispatch(slice.actions.getProductReviewsSuccess(response.data.productreviews)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// }