fixes: pagination & users permissions

This commit is contained in:
Alexandro Uc Santos
2024-03-13 21:39:26 -06:00
parent cbd076e887
commit c286da773e
18 changed files with 92 additions and 63 deletions

View File

@@ -19,12 +19,14 @@
getInitData();
})
const limit = 3;
const limit = 5;
const getInitData = async() => {
loading.value = true;
// companyStore.locationsCurrentPage = companyStore.locationsCurrentPage;
filterQuery.value.company = "company="+ localStorage.getItem('id');
filterQuery.value.limit = "elements=" + limit;
filterQuery.value.page = "page=" + 0;
await companyStore.getLocationsCompany(filterQuery.value, false)
loading.value = false;
}
@@ -32,7 +34,7 @@
const getLocationsByPage = async(data) => {
loading.value = true;
filterQuery.value.company = "company="+ localStorage.getItem('id');
filterQuery.value.skip = "$skip="+ data.skip;
filterQuery.value.page = "page=" + data.page;
companyStore.locationsCurrentPage = data.page
await companyStore.getLocationsCompany(filterQuery.value, true)
loading.value = false;
@@ -45,8 +47,8 @@
}
watch(query, () => {
filterQuery.value.skip = "$skip="+ 0;
filterQuery.value.limit = "$limit="+ 100;
filterQuery.value.page = "page=" + 0;
filterQuery.value.limit = "elements=" + 100;
if(query.value.length === 0){
clearRequest();
filterQuery.value.search = "";
@@ -77,9 +79,9 @@
}
const clearRequest = () => {
filterQuery.value.skip = "$skip="+ 0;
filterQuery.value.limit = "$limit="+ limit;
companyStore.locationsCurrentPage = 1;
filterQuery.value.page = "page=" + 0;
filterQuery.value.limit = "elements="+ limit;
companyStore.locationsCurrentPage = 0;
}
const handleSetCurrentLocation = (location) => {