A deployable markdown editor that connects with your self hosted files and lets you edit in a beautiful interface
1import { apiClient } from './client';
2import type { User, UserRepo } from '../types/api';
3
4export const authApi = {
5 getCurrentUser: async (): Promise<User> => {
6 const { data } = await apiClient.get<User>('/api/auth/user');
7 return data;
8 },
9
10 getUserRepos: async (): Promise<UserRepo[]> => {
11 const { data } = await apiClient.get<UserRepo[]>('/api/user/repos');
12 return data;
13 },
14
15 logout: async (): Promise<void> => {
16 await apiClient.post('/api/auth/logout');
17 },
18};