2025-11-19 22:03:35 +01:00
|
|
|
import type { ContactRequest, ContactResponse } from '~/types/api/contact';
|
|
|
|
|
import type { MetaResponse } from '~/types/api/meta';
|
2025-11-19 22:03:35 +01:00
|
|
|
import type { UseApiResponse } from './useApi';
|
2025-11-19 22:03:35 +01:00
|
|
|
|
2025-11-11 19:12:21 +01:00
|
|
|
export const useBackend = () => {
|
|
|
|
|
const api = useApi();
|
|
|
|
|
|
2025-11-19 22:03:35 +01:00
|
|
|
const getMeta = (): UseApiResponse<MetaResponse> => api.get<MetaResponse>('/meta');
|
|
|
|
|
const postContact = (): UseApiResponse<ContactResponse, ContactRequest> =>
|
2026-02-04 15:19:08 +01:00
|
|
|
api.post<ContactResponse, ContactRequest>('/contact', undefined, false);
|
2025-11-11 19:12:21 +01:00
|
|
|
|
|
|
|
|
return { getMeta, postContact };
|
|
|
|
|
};
|