add: search loads
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user