fix: 화면 정리

미사용 소스정리
main
minuk926 3 years ago
parent 408ec70720
commit fe9d9996fa

@ -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));
// }
// };
// }

Loading…
Cancel
Save