test-iki-mini-app
Version:
ứng dựng bán hàng trên mini app z a l o
34 lines (27 loc) • 780 B
JSX
import { callApi } from "../api/index.jsx";
import { constants as c } from "../constants";
const apiNews = () => {
return callApi(`/customer/${c.STORE_CODE}/home_web/posts_new`, "get");
};
const getPostCategories = () => {
return callApi(`/customer/${c.STORE_CODE}/post_categories`, "get");
};
const getAllPost = () => {
return callApi(`/customer/${c.STORE_CODE}/posts`, "get");
};
const getNewsDetail = (post) => {
return callApi(`/customer/${c.STORE_CODE}/posts/${post.idNews}`, "get");
};
const newsByCategory = (post) => {
return callApi(
`/customer/${c.STORE_CODE}/posts?danh-muc=${post.slug}-${post.id}&category_ids=${post.id}&`,
"get"
);
};
export const news = {
apiNews,
getPostCategories,
getAllPost,
getNewsDetail,
newsByCategory,
};