add: search loads

This commit is contained in:
Alexandro Uc Santos
2023-12-18 21:25:56 -06:00
parent 2a4bde6024
commit bc49895b01
10 changed files with 335 additions and 12 deletions

View File

@@ -1,9 +1,11 @@
import { ref } from "vue";
import { getCompanies } from '../services/public';
import { getCompanies, getPublicUsersCompany } from '../services/public';
export default function useDirecty() {
export default function useDirectory() {
const companies = ref([]);
const loading = ref(false);
const users = ref([]);
const getCompaniesData = async(filterQuery) => {
let filterArr = Object.values(filterQuery);
@@ -21,8 +23,18 @@ export default function useDirecty() {
loading.value = false;
}
const getUsersData = async(companyId) => {
const filter = companyId;
loading.value = true;
const resp = await getPublicUsersCompany(filter);
users.value = resp;
loading.value = false;
}
return {
getCompaniesData,
getUsersData,
users,
loading,
companies
}