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

18 lines
545 B
TypeScript

import { GET_PAYMENTS_LIMITS } from '@graphql/queries/standalone/company';
import type { IPaymentsLimitsResponse } from '@types';
export function usePaymentLimits() {
const { data, error } = useAsyncQuery<IPaymentsLimitsResponse>(GET_PAYMENTS_LIMITS);
const paymentMin = computed(() => data.value?.paymentsLimits?.minAmount ?? 0);
const paymentMax = computed(() => data.value?.paymentsLimits?.maxAmount ?? 500);
watch(error, (e) => {
if (e) console.error('usePaymentLimits error:', e);
});
return {
paymentMin,
paymentMax,
};
}