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-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> =>
|
|
|
|
|
api.post<ContactResponse, ContactRequest>('/contact', false);
|
2025-11-11 19:12:21 +01:00
|
|
|
|
|
|
|
|
return { getMeta, postContact };
|
|
|
|
|
};
|