fixed tickets fetching count

This commit is contained in:
Mamalizz
2025-06-04 19:13:41 +03:30
parent 5e5f9aa732
commit a3e76e5073
2 changed files with 15 additions and 12 deletions
@@ -21,17 +21,14 @@ const useGetAllTickets = (params: ComputedRef<GetAllTicketsRequest>) => {
// methods
const handleGetAllTickets = async (params: GetAllTicketsRequest) => {
const { data } = await axios.get<GetAllTicketsResponse>(
API_ENDPOINTS.tickets.get_all,
{
const { data } = await axios.get<GetAllTicketsResponse>(API_ENDPOINTS.tickets.get_all, {
params: {
sort: params.sort,
filter: params.status,
offset: Number(params.page) * 10 - 10,
limit: 10,
offset: Number(params.page) * 7 - 7,
limit: 7,
},
}
);
});
return data;
};
+7 -1
View File
@@ -16,7 +16,12 @@ definePageMeta({
// state
const params = useUrlSearchParams("history") as GetAllTicketsRequest;
const params: GetAllTicketsRequest = useUrlSearchParams("history", {
initialValue: {
page: 1,
},
writeMode: "push",
});
const filters = computed(() => {
return {
@@ -236,6 +241,7 @@ const clearFilters = () => {
<Pagination
:items="paginationData"
:total="data?.count"
:per-page="7"
/>
</div>
</div>