mirror of
https://github.com/andrigamerita/simpkey
synced 2025-02-17 20:30:49 +01:00
ua
This commit is contained in:
parent
913593a64f
commit
b5ac8fa83f
@ -2,7 +2,9 @@ import axios from 'axios';
|
|||||||
import { User } from './models/User';
|
import { User } from './models/User';
|
||||||
import { Note } from './models/Note';
|
import { Note } from './models/Note';
|
||||||
|
|
||||||
export async function api<T>(host: string, endpoint: string, opts: { [_: string]: string }): Promise<T> {
|
axios.defaults.headers['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36';
|
||||||
|
|
||||||
|
export async function api<T>(host: string, endpoint: string, opts: Record<string, string>): Promise<T> {
|
||||||
const res = await axios.post<T>(`https://${host}/api/${endpoint}`, opts);
|
const res = await axios.post<T>(`https://${host}/api/${endpoint}`, opts);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user