@esvndev/es-react-template-chat 0.0.38 → 0.0.39

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.mjs CHANGED
@@ -5,7 +5,7 @@ import '@styles/base/pages/app-chat.scss';
5
5
  import '@styles/base/pages/app-chat-list.scss';
6
6
  import 'react-dom';
7
7
  import { useAppDispatch, useAppSelector } from '@src/redux/configureStore';
8
- import * as ____toolkit from '@reduxjs/toolkit';
8
+ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
9
9
 
10
10
  var isBlazorPlatform = false;
11
11
  /**
@@ -26272,28 +26272,26 @@ const initialState = {
26272
26272
  pinnedMessages: [],
26273
26273
  typingUsers: {}
26274
26274
  };
26275
- const get_history = (params) => {
26276
- return ____toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GET_HISTORY, async (params, thunkAPI) => {
26277
- try {
26278
- const queryString = new URLSearchParams(params).toString();
26279
- const response = await fetch(`${CHAT.URL_API.GET_HISTORY_API}?${queryString}`, {
26280
- method: 'GET',
26281
- headers: {
26282
- 'Authorization': `Bearer ${getToken()}`,
26283
- 'Content-Type': 'application/json'
26284
- }
26285
- });
26286
- if (!response.ok) {
26287
- throw new Error(`HTTP error! status: ${response.status}`);
26275
+ const get_history = createAsyncThunk(CHAT.ACTION_TYPES.GET_HISTORY, async (params, thunkAPI) => {
26276
+ try {
26277
+ const queryString = new URLSearchParams(params).toString();
26278
+ const response = await fetch(`${CHAT.URL_API.GET_HISTORY_API}?${queryString}`, {
26279
+ method: 'GET',
26280
+ headers: {
26281
+ 'Authorization': `Bearer ${getToken()}`,
26282
+ 'Content-Type': 'application/json'
26288
26283
  }
26289
- const data = await response.json();
26290
- return data;
26291
- }
26292
- catch (error) {
26293
- return thunkAPI.rejectWithValue({ error: error.message });
26284
+ });
26285
+ if (!response.ok) {
26286
+ throw new Error(`HTTP error! status: ${response.status}`);
26294
26287
  }
26295
- });
26296
- };
26288
+ const data = await response.json();
26289
+ return data;
26290
+ }
26291
+ catch (error) {
26292
+ return thunkAPI.rejectWithValue({ error: error.message });
26293
+ }
26294
+ });
26297
26295
  // export const get_history = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.GET_HISTORY, async (params, thunkAPI) => {
26298
26296
  // try {
26299
26297
  // return await api.chatApi.getHistory(params)
@@ -26470,7 +26468,7 @@ const get_history = (params) => {
26470
26468
  // return thunkAPI.rejectWithValue({ error: error.response?.data || error.data })
26471
26469
  // }
26472
26470
  // })
26473
- const appChatSlice = ____toolkit.createSlice({
26471
+ const appChatSlice = createSlice({
26474
26472
  name: 'appChat',
26475
26473
  initialState,
26476
26474
  reducers: {
@@ -26841,7 +26839,7 @@ const useChat = () => {
26841
26839
  const dispatch = useAppDispatch();
26842
26840
  const { active, checkInit, chatRoomId, userLogin, listContact, contactId, typeChat, loadChat, messageByGroup, listHistory, listChatType, archiveStore, checkScroll, listGeneralGroup, pinnedMessages, typingUsers } = useAppSelector((state) => state.chat);
26843
26841
  const getHistoryApi = (params) => {
26844
- return dispatch(get_history());
26842
+ return dispatch(get_history(params));
26845
26843
  };
26846
26844
  // const getHistoryApi = async (params: any) => {
26847
26845
  // const queryString = new URLSearchParams(params).toString()