amplitudeRepo.ts
3 months ago
formsRepo.ts
6 months ago
hostingRepo.ts
3 months ago
index.ts
3 months ago
pagesRepo.ts
10 months ago
reachRepo.ts
1 month ago
hostingRepo.ts
24 lines
| 1 | import { useGeneralDataStore } from '@/stores/generalDataStore'; |
| 2 | import { Header } from '@/types/enums'; |
| 3 | import type { AuthorizeRequestHeaders } from '@/types/models'; |
| 4 | import type { DomainDetails } from '@/types/models/hostingDataModels'; |
| 5 | import { generateCorrelationId } from '@/utils/helpers'; |
| 6 | import httpService from '@/utils/services/httpService'; |
| 7 | |
| 8 | const URL = `${hostinger_reach_reach_data.rest_base_url}hostinger-reach/v1`; |
| 9 | |
| 10 | export const hostingRepo = { |
| 11 | getDomainDetails: (headers?: AuthorizeRequestHeaders) => { |
| 12 | const { nonce } = useGeneralDataStore(); |
| 13 | |
| 14 | const config = { |
| 15 | headers: { |
| 16 | [Header.CORRELATION_ID]: headers?.[Header.CORRELATION_ID] || generateCorrelationId(), |
| 17 | [Header.WP_NONCE]: nonce |
| 18 | } |
| 19 | }; |
| 20 | |
| 21 | return httpService.get<DomainDetails>(`${URL}/hosting/domain-details`, config); |
| 22 | } |
| 23 | }; |
| 24 |