fixed tickets fetching count
This commit is contained in:
@@ -21,17 +21,14 @@ const useGetAllTickets = (params: ComputedRef<GetAllTicketsRequest>) => {
|
|||||||
// methods
|
// methods
|
||||||
|
|
||||||
const handleGetAllTickets = async (params: GetAllTicketsRequest) => {
|
const handleGetAllTickets = async (params: GetAllTicketsRequest) => {
|
||||||
const { data } = await axios.get<GetAllTicketsResponse>(
|
const { data } = await axios.get<GetAllTicketsResponse>(API_ENDPOINTS.tickets.get_all, {
|
||||||
API_ENDPOINTS.tickets.get_all,
|
params: {
|
||||||
{
|
sort: params.sort,
|
||||||
params: {
|
filter: params.status,
|
||||||
sort: params.sort,
|
offset: Number(params.page) * 7 - 7,
|
||||||
filter: params.status,
|
limit: 7,
|
||||||
offset: Number(params.page) * 10 - 10,
|
},
|
||||||
limit: 10,
|
});
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,12 @@ definePageMeta({
|
|||||||
|
|
||||||
// state
|
// state
|
||||||
|
|
||||||
const params = useUrlSearchParams("history") as GetAllTicketsRequest;
|
const params: GetAllTicketsRequest = useUrlSearchParams("history", {
|
||||||
|
initialValue: {
|
||||||
|
page: 1,
|
||||||
|
},
|
||||||
|
writeMode: "push",
|
||||||
|
});
|
||||||
|
|
||||||
const filters = computed(() => {
|
const filters = computed(() => {
|
||||||
return {
|
return {
|
||||||
@@ -236,6 +241,7 @@ const clearFilters = () => {
|
|||||||
<Pagination
|
<Pagination
|
||||||
:items="paginationData"
|
:items="paginationData"
|
||||||
:total="data?.count"
|
:total="data?.count"
|
||||||
|
:per-page="7"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user