20 lines
486 B
TypeScript
20 lines
486 B
TypeScript
import { GET_COMPANY_INFO } from '@graphql/queries/standalone/company';
|
|
import type { ICompanyResponse } from '@types';
|
|
|
|
export async function useCompanyInfo() {
|
|
const companyStore = useCompanyStore();
|
|
|
|
const { data, error } = await useAsyncQuery<ICompanyResponse>(GET_COMPANY_INFO);
|
|
|
|
if (data.value?.parameters) {
|
|
companyStore.setCompanyInfo(data.value.parameters);
|
|
}
|
|
|
|
watch(error, (err) => {
|
|
if (err) {
|
|
console.error('useCompanyInfo error:', err);
|
|
}
|
|
});
|
|
|
|
return {};
|
|
}
|