categories params

This commit is contained in:
VividTruthKeeper 2023-02-23 08:41:03 +05:00
parent 09cc3f21e3
commit 2e1c739430
2 changed files with 13 additions and 1 deletions

View File

@ -10,3 +10,14 @@ export const newsScrollParams: IurlParamAdder[] = [
value: 1,
},
];
export const categoriesParams: IurlParamAdder[] = [
{
name: "count",
value: 7,
},
{
name: "page",
value: 1,
},
];

View File

@ -18,6 +18,7 @@ import { url } from "../../url";
// Components
import Loader from "../global/Loader";
import SubNavLi from "./SubNavLi";
import { categoriesParams } from "../../api/params";
const SubNav = () => {
const activeLink = useSelector<RootState, RootState["activeLink"]["active"]>(
@ -36,7 +37,7 @@ const SubNav = () => {
const [data, setData] = useState<ICategoriesData>();
// Api
const api = new Api(url + "/categories");
const api = new Api(url + "/categories", categoriesParams);
useEffect(() => {
api.get(data, setData);