@esvndev/es-react-template-chat 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -11
- package/dist/index.mjs.map +1 -1
- package/dist/request/chat/index.d.ts +1 -1
- package/dist/request/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -26232,18 +26232,18 @@ const getToken = () => {
|
|
|
26232
26232
|
|
|
26233
26233
|
// import requester from '../requester'
|
|
26234
26234
|
const { URL_API } = CHAT;
|
|
26235
|
-
({
|
|
26236
|
-
headers: {
|
|
26237
|
-
Authorization: `Bearer ${getToken()}`
|
|
26238
|
-
}
|
|
26239
|
-
});
|
|
26240
26235
|
const chatApi = {
|
|
26241
|
-
getHistory: (params) => {
|
|
26242
|
-
|
|
26243
|
-
|
|
26244
|
-
|
|
26245
|
-
|
|
26246
|
-
|
|
26236
|
+
getHistory: async (params) => {
|
|
26237
|
+
const queryString = new URLSearchParams(params).toString();
|
|
26238
|
+
const response = await fetch(`${URL_API.GET_HISTORY_API}?${queryString}`, {
|
|
26239
|
+
headers: {
|
|
26240
|
+
'Authorization': `Bearer ${getToken()}`,
|
|
26241
|
+
'Content-Type': 'application/json'
|
|
26242
|
+
}
|
|
26243
|
+
});
|
|
26244
|
+
if (!response.ok)
|
|
26245
|
+
throw new Error(`Error: ${response.status}`);
|
|
26246
|
+
return response.json();
|
|
26247
26247
|
}
|
|
26248
26248
|
//getHistoryActive: (params: any) => requester.get(URL_API.GET_HISTORY_API, params, config),
|
|
26249
26249
|
//getHistory: (params: any) => requester.get(URL_API.GET_HISTORY_API, params, config)
|