fixed tickets fetching count
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user