🧼
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Client } from '../types'
|
||||
import axios from 'axios'
|
||||
import { client, clients, session } from '../data'
|
||||
import { client, clients } from '../data'
|
||||
import settings from '../settings'
|
||||
|
||||
const apiUrl = '/api'
|
||||
@@ -20,19 +20,10 @@ export const getClient = async (id: string): Promise<Client> => {
|
||||
return res.data
|
||||
}
|
||||
export const startSession = async (clientId: string) => {
|
||||
//
|
||||
const res = await axios.post(`${apiUrl}/clients/${clientId}/session`)
|
||||
return res.data // session data
|
||||
}
|
||||
|
||||
export const getSession = async (
|
||||
clientId: string,
|
||||
): Promise<null | string[]> => {
|
||||
if (settings.env === 'jank') return session
|
||||
const res = await axios.get(`${apiUrl}/clients/${clientId}/session`)
|
||||
return res.data as null | string[]
|
||||
}
|
||||
|
||||
export const killSession = async (clientId: string) => {
|
||||
await axios.delete(`${apiUrl}/clients/${clientId}/session`)
|
||||
}
|
||||
|
Reference in New Issue
Block a user