parent
937b3fc811
commit
f3a61bfa99
21 changed files with 55 additions and 1071 deletions
|
@ -1,5 +1,5 @@
|
|||
import axios from 'axios';
|
||||
import { CreateLinkRequest, Link, AuthResponse, ClickStats, SourceStats } from '../types/api';
|
||||
import { CreateLinkRequest, Link, AuthResponse } from '../types/api';
|
||||
|
||||
// Create axios instance with default config
|
||||
const api = axios.create({
|
||||
|
@ -45,16 +45,4 @@ export const getAllLinks = async () => {
|
|||
|
||||
export const deleteLink = async (id: number) => {
|
||||
await api.delete(`/links/${id}`);
|
||||
};
|
||||
|
||||
export const getLinkClickStats = async (id: number) => {
|
||||
const response = await api.get<ClickStats[]>(`/links/${id}/clicks`);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const getLinkSourceStats = async (id: number) => {
|
||||
const response = await api.get<SourceStats[]>(`/links/${id}/sources`);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export { api };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue