schon/storefront/app/composables/company/useCompanyInfo.ts
2026-02-27 21:59:51 +03:00

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 {};
}