This commit is contained in:
waveringana 2025-01-25 02:18:36 -05:00
commit c048377bcc
32 changed files with 4748 additions and 0 deletions

View file

@ -0,0 +1,17 @@
import axios from 'axios';
import { CreateLinkRequest, Link } from '../types/api';
const api = axios.create({
baseURL: '/api',
});
export const createShortLink = async (data: CreateLinkRequest) => {
const response = await api.post<Link>('/shorten', data);
return response.data;
};
export const getAllLinks = async () => {
const response = await api.get<Link[]>('/links');
return response.data;
};