import { useAp2iRequestService } from '~/composables/data/useAp2iRequestService'
import SubdomainValidation from '~/services/validation/subdomainValidation'

let subdomainValidation: SubdomainValidation | null = null

export function useSubdomainValidation() {
  if (subdomainValidation === null) {
    const { apiRequestService } = useAp2iRequestService()

    subdomainValidation = new SubdomainValidation(apiRequestService)
  }
  return { subdomainValidation }
}
