mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-16 23:48:09 +01:00
Add presets and endpoints data services
This commit is contained in:
parent
f2d18c81fc
commit
3d0bfaef51
5 changed files with 102 additions and 126 deletions
|
|
@ -1,13 +1,12 @@
|
|||
import axios, { AxiosRequestConfig } from "axios";
|
||||
|
||||
async function _get<T>(url: string, options?: AxiosRequestConfig): Promise<T> {
|
||||
const response = await axios.get(url, {...options});
|
||||
const response = await axios.get(url, { withCredentials: true, ...options});
|
||||
return response.data;
|
||||
}
|
||||
|
||||
async function _post(url: string, arg?: any) {
|
||||
const modifiedData = {arg, withCredentials: true}
|
||||
const response = await axios.post(url, modifiedData, {
|
||||
async function _post(url: string, data?: any) {
|
||||
const response = await axios.post(url, JSON.stringify(data), {
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
return response.data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue