@esvndev/es-react-template-chat 0.0.20 → 0.0.22

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.
@@ -31,29 +31,6 @@ interface IFState {
31
31
  typingUsers: any;
32
32
  }
33
33
  export declare const get_history: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
34
- export declare const get_message_by_group_cursor: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
35
- export declare const get_history_active: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
36
- export declare const get_info: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
37
- export declare const groups: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
38
- export declare const addMemberGroup: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
39
- export declare const sen_message: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
40
- export declare const delete_message: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
41
- export declare const recall_message: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
42
- export declare const update_group_avatar: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
43
- export declare const get_message_by_group: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
44
- export declare const get_message_by_contact: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
45
- export declare const contact_add: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
46
- export declare const connectChatRoomMemberApi: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
47
- export declare const get_profile: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
48
- export declare const get_users: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
49
- export declare const get_contact: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
50
- export declare const update_chat_room_member: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
51
- export declare const getPagingEmployeeApi: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
52
- export declare const pinMessageChatRoomApi: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
53
- export declare const getPinMessageChatRoomApi: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
54
- export declare const deletePinMessageApi: import("@reduxjs/toolkit").AsyncThunk<any, string, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
55
- export declare const updateGroupTagApi: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
56
- export declare const createReminderApi: import("@reduxjs/toolkit").AsyncThunk<any, any, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
57
34
  export declare const appChatSlice: import("@reduxjs/toolkit").Slice<IFState, {
58
35
  selectChat(state: import("immer").WritableDraft<IFState>, action: {
59
36
  payload: any;
package/dist/index.js CHANGED
@@ -45845,7 +45845,10 @@ const config$2 = {
45845
45845
  };
45846
45846
  const chatApi = {
45847
45847
  getHistoryActive: (params) => requester.get(URL_API$1.GET_HISTORY_API, params, config$2),
45848
- getHistory: (params) => requester.get(URL_API$1.GET_HISTORY_API, params, config$2),
45848
+ //getHistory: (params: any) => requester.get(URL_API.GET_HISTORY_API, params, config),
45849
+ getHistory: (params) => {
45850
+ console.log('getHistory params', params);
45851
+ },
45849
45852
  getMessageByGroupCursor: (id, params) => requester.get(`${URL_API$1.GET_MESSAGE_BY_GROUP_CURSOR_API}/${id}`, params, config$2),
45850
45853
  getInfo: (params) => requester.get(URL_API$1.GET_INFO_API, params, config$2),
45851
45854
  groups: (params) => requester.post(URL_API$1.GROUP_API, params, config$2),
@@ -46037,203 +46040,188 @@ const initialState = {
46037
46040
  };
46038
46041
  const get_history = toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GET_HISTORY, async (params, thunkAPI) => {
46039
46042
  try {
46040
- //return await api.chatApi.getHistory(params)
46041
- return await [];
46042
- }
46043
- catch (error) {
46044
- return thunkAPI.rejectWithValue({ error: error.response.data });
46045
- }
46046
- });
46047
- toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GET_MESSAGE_BY_GROUP_CURSOR, async (params, thunkAPI) => {
46048
- try {
46049
- return await api.chatApi.getMessageByGroupCursor(params.chatRoomId, params);
46050
- }
46051
- catch (error) {
46052
- return thunkAPI.rejectWithValue({ error: error.response.data });
46053
- }
46054
- });
46055
- toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GET_HISTORY_ACTIVE, async (params, thunkAPI) => {
46056
- try {
46057
- return await api.chatApi.getHistoryActive(params);
46058
- }
46059
- catch (error) {
46060
- return thunkAPI.rejectWithValue({ error: error.response.data });
46061
- }
46062
- });
46063
- toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GET_INFO, async (params, thunkAPI) => {
46064
- try {
46065
- return await api.chatApi.getInfo(params);
46066
- }
46067
- catch (error) {
46068
- return thunkAPI.rejectWithValue({ error: error.response.data });
46069
- }
46070
- });
46071
- const groups = toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GROUP, async (params, thunkAPI) => {
46072
- try {
46073
- return await api.chatApi.groups(params);
46074
- }
46075
- catch (error) {
46076
- return thunkAPI.rejectWithValue({ error: error.response.data });
46077
- }
46078
- });
46079
- const addMemberGroup = toolkit.createAsyncThunk(CHAT.ACTION_TYPES.MEMBER_GROUP, async (params, thunkAPI) => {
46080
- try {
46081
- return await api.chatApi.addMemberGroup(params);
46082
- }
46083
- catch (error) {
46084
- return thunkAPI.rejectWithValue({ error: error.response.data });
46085
- }
46086
- });
46087
- toolkit.createAsyncThunk(CHAT.ACTION_TYPES.SEN_MESSAGE, async (params, thunkAPI) => {
46088
- try {
46089
- return await api.chatApi.senMessage(params.id, params.formData, params.tickerDto);
46090
- }
46091
- catch (error) {
46092
- return thunkAPI.rejectWithValue({ error: error.response.data });
46093
- }
46094
- });
46095
- toolkit.createAsyncThunk(CHAT.ACTION_TYPES.DELETE_MESSAGE, async (params, thunkAPI) => {
46096
- try {
46097
- return await api.chatApi.deleteMessage(params.id, params.chatRoomId);
46098
- }
46099
- catch (error) {
46100
- return thunkAPI.rejectWithValue({ error: error.response.data });
46101
- }
46102
- });
46103
- toolkit.createAsyncThunk(CHAT.ACTION_TYPES.RECALL_MESSAGE, async (params, thunkAPI) => {
46104
- try {
46105
- return await api.chatApi.recallMessage(params.id, params.chatRoomId);
46106
- }
46107
- catch (error) {
46108
- return thunkAPI.rejectWithValue({ error: error.response.data });
46109
- }
46110
- });
46111
- toolkit.createAsyncThunk(CHAT.ACTION_TYPES.UPDATE_GROUP_AVATAR, async (params, thunkAPI) => {
46112
- try {
46113
- return await api.chatApi.updateGroupAvatar(params);
46114
- }
46115
- catch (error) {
46116
- return thunkAPI.rejectWithValue({ error: error.response.data });
46117
- }
46118
- });
46119
- toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GET_MESSAGE_BY_GROUP, async (params, thunkAPI) => {
46120
- try {
46121
- return await api.chatApi.getMessageByGroup(params.chatRoomId, params.paging);
46122
- }
46123
- catch (error) {
46124
- return thunkAPI.rejectWithValue({ error: error.response.data });
46125
- }
46126
- });
46127
- toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GET_MESSAGE_BY_CONTACT, async (params, thunkAPI) => {
46128
- try {
46129
- return await api.chatApi.getMessageByContact(params.chatRoomId, params.paging);
46130
- }
46131
- catch (error) {
46132
- return thunkAPI.rejectWithValue({ error: error.response.data });
46133
- }
46134
- });
46135
- const contact_add = toolkit.createAsyncThunk(CHAT.ACTION_TYPES.CONTACT_ADD, async (params, thunkAPI) => {
46136
- try {
46137
- return await api.chatApi.contactAdd(params);
46138
- }
46139
- catch (error) {
46140
- return thunkAPI.rejectWithValue({ error: error.response.data });
46141
- }
46142
- });
46143
- toolkit.createAsyncThunk(CHAT.ACTION_TYPES.CONNECT_CHAT_ROOM_MEMBER, async (params, thunkAPI) => {
46144
- try {
46145
- return await api.chatApi.connectChatRoomMemberApi(params);
46146
- }
46147
- catch (error) {
46148
- return thunkAPI.rejectWithValue({ error: error.response.data });
46149
- }
46150
- });
46151
- const get_profile = toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GET_PROFILE, async (_, thunkAPI) => {
46152
- try {
46153
- return await api.chatApi.getProfile();
46043
+ return await api.chatApi.getHistory(params);
46154
46044
  }
46155
46045
  catch (error) {
46156
46046
  return thunkAPI.rejectWithValue({ error: error.response.data });
46157
46047
  }
46158
46048
  });
46159
- toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GET_USERS, async (params, thunkAPI) => {
46160
- try {
46161
- return await api.chatApi.getUsers(params);
46162
- }
46163
- catch (error) {
46164
- return thunkAPI.rejectWithValue({ error: error.response.data });
46165
- }
46166
- });
46167
- const get_contact = toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GET_CONTACT, async (params, thunkAPI) => {
46168
- try {
46169
- return await api.chatApi.getContact(params);
46170
- }
46171
- catch (error) {
46172
- return thunkAPI.rejectWithValue({ error: error.response.data });
46173
- }
46174
- });
46175
- const update_chat_room_member = toolkit.createAsyncThunk(CHAT.ACTION_TYPES.CHAT_ROOM_MEMBER, async (params, thunkAPI) => {
46176
- try {
46177
- return await api.chatApi.updateChatRoomMember(params);
46178
- }
46179
- catch (error) {
46180
- return thunkAPI.rejectWithValue({ error: error.response.data });
46181
- }
46182
- });
46183
- toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GET_PAGING_EMPLOYEE, async (params, thunkAPI) => {
46184
- try {
46185
- const response = await api.chatApi.getPagingEmployeeApi(params);
46186
- return response;
46187
- }
46188
- catch (error) {
46189
- return thunkAPI.rejectWithValue({ error: error.data });
46190
- }
46191
- });
46192
- toolkit.createAsyncThunk(CHAT.ACTION_TYPES.PIN_MESSAGE_CHAT_ROOM, async (params, thunkAPI) => {
46193
- try {
46194
- const response = await api.chatApi.pinMessageChatRoomApi(params);
46195
- return response;
46196
- }
46197
- catch (error) {
46198
- return thunkAPI.rejectWithValue({ error: error.data });
46199
- }
46200
- });
46201
- const getPinMessageChatRoomApi = toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GET_PIN_MESSAGES_BY_ROOM, async (params, thunkAPI) => {
46202
- try {
46203
- const response = await api.chatApi.getPinMessagesByRoomApi(params);
46204
- return response;
46205
- }
46206
- catch (error) {
46207
- return thunkAPI.rejectWithValue({ error: error.data });
46208
- }
46209
- });
46210
- const deletePinMessageApi = toolkit.createAsyncThunk(CHAT.ACTION_TYPES.DELETE_PIN_MESSAGE, async (pinId, thunkAPI) => {
46211
- try {
46212
- const response = await api.chatApi.deletePinMessageApi(pinId);
46213
- return response;
46214
- }
46215
- catch (error) {
46216
- return thunkAPI.rejectWithValue({ error: error.data });
46217
- }
46218
- });
46219
- toolkit.createAsyncThunk(CHAT.ACTION_TYPES.UPDATE_GROUP_TAG, async (params, thunkAPI) => {
46220
- try {
46221
- const response = await api.chatApi.updateGroupTagApi(params);
46222
- return response;
46223
- }
46224
- catch (error) {
46225
- return thunkAPI.rejectWithValue({ error: error.response?.data || error.data });
46226
- }
46227
- });
46228
- toolkit.createAsyncThunk(CHAT.ACTION_TYPES.CREATE_REMINDER, async (params, thunkAPI) => {
46229
- try {
46230
- const response = await api.chatApi.createReminderApi(params);
46231
- return response;
46232
- }
46233
- catch (error) {
46234
- return thunkAPI.rejectWithValue({ error: error.response?.data || error.data });
46235
- }
46236
- });
46049
+ // export const get_history = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.GET_HISTORY, async (params, thunkAPI) => {
46050
+ // try {
46051
+ // return await api.chatApi.getHistory(params)
46052
+ // } catch (error: any) {
46053
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46054
+ // }
46055
+ // })
46056
+ // export const get_message_by_group_cursor = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.GET_MESSAGE_BY_GROUP_CURSOR, async (params, thunkAPI) => {
46057
+ // try {
46058
+ // return await api.chatApi.getMessageByGroupCursor(params.chatRoomId, params)
46059
+ // } catch (error: any) {
46060
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46061
+ // }
46062
+ // })
46063
+ // export const get_history_active = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.GET_HISTORY_ACTIVE, async (params, thunkAPI) => {
46064
+ // try {
46065
+ // return await api.chatApi.getHistoryActive(params)
46066
+ // } catch (error: any) {
46067
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46068
+ // }
46069
+ // })
46070
+ // export const get_info = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.GET_INFO, async (params, thunkAPI) => {
46071
+ // try {
46072
+ // return await api.chatApi.getInfo(params)
46073
+ // } catch (error: any) {
46074
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46075
+ // }
46076
+ // })
46077
+ // export const groups = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.GROUP, async (params, thunkAPI) => {
46078
+ // try {
46079
+ // return await api.chatApi.groups(params)
46080
+ // } catch (error: any) {
46081
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46082
+ // }
46083
+ // })
46084
+ // export const addMemberGroup = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.MEMBER_GROUP, async (params, thunkAPI) => {
46085
+ // try {
46086
+ // return await api.chatApi.addMemberGroup(params)
46087
+ // } catch (error :any) {
46088
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46089
+ // }
46090
+ // })
46091
+ // export const sen_message = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.SEN_MESSAGE, async (params, thunkAPI) => {
46092
+ // try {
46093
+ // return await api.chatApi.senMessage(params.id, params.formData, params.tickerDto)
46094
+ // } catch (error: any) {
46095
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46096
+ // }
46097
+ // })
46098
+ // export const delete_message = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.DELETE_MESSAGE, async (params, thunkAPI) => {
46099
+ // try {
46100
+ // return await api.chatApi.deleteMessage(params.id, params.chatRoomId)
46101
+ // } catch (error: any) {
46102
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46103
+ // }
46104
+ // }
46105
+ // )
46106
+ // export const recall_message = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.RECALL_MESSAGE, async (params, thunkAPI) => {
46107
+ // try {
46108
+ // return await api.chatApi.recallMessage(params.id, params.chatRoomId)
46109
+ // } catch (error: any) {
46110
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46111
+ // }
46112
+ // }
46113
+ // )
46114
+ // export const update_group_avatar = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.UPDATE_GROUP_AVATAR, async (params, thunkAPI) => {
46115
+ // try {
46116
+ // return await api.chatApi.updateGroupAvatar(params)
46117
+ // } catch (error: any) {
46118
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46119
+ // }
46120
+ // })
46121
+ // export const get_message_by_group = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.GET_MESSAGE_BY_GROUP, async (params, thunkAPI) => {
46122
+ // try {
46123
+ // return await api.chatApi.getMessageByGroup(params.chatRoomId, params.paging)
46124
+ // } catch (error: any) {
46125
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46126
+ // }
46127
+ // })
46128
+ // export const get_message_by_contact = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.GET_MESSAGE_BY_CONTACT, async (params, thunkAPI) => {
46129
+ // try {
46130
+ // return await api.chatApi.getMessageByContact(params.chatRoomId, params.paging)
46131
+ // } catch (error: any) {
46132
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46133
+ // }
46134
+ // })
46135
+ // export const contact_add = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.CONTACT_ADD, async (params, thunkAPI) => {
46136
+ // try {
46137
+ // return await api.chatApi.contactAdd(params)
46138
+ // } catch (error: any) {
46139
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46140
+ // }
46141
+ // })
46142
+ // export const connectChatRoomMemberApi = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.CONNECT_CHAT_ROOM_MEMBER, async (params, thunkAPI) => {
46143
+ // try {
46144
+ // return await api.chatApi.connectChatRoomMemberApi(params)
46145
+ // } catch (error: any) {
46146
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46147
+ // }
46148
+ // })
46149
+ // export const get_profile = createAsyncThunk<any>(CHAT.ACTION_TYPES.GET_PROFILE, async (_: void, thunkAPI) => {
46150
+ // try {
46151
+ // return await api.chatApi.getProfile()
46152
+ // } catch (error: any) {
46153
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46154
+ // }
46155
+ // })
46156
+ // export const get_users = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.GET_USERS, async (params, thunkAPI) => {
46157
+ // try {
46158
+ // return await api.chatApi.getUsers(params)
46159
+ // } catch (error: any) {
46160
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46161
+ // }
46162
+ // })
46163
+ // export const get_contact = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.GET_CONTACT, async (params, thunkAPI) => {
46164
+ // try {
46165
+ // return await api.chatApi.getContact(params)
46166
+ // } catch (error: any) {
46167
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46168
+ // }
46169
+ // })
46170
+ // export const update_chat_room_member = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.CHAT_ROOM_MEMBER, async (params, thunkAPI) => {
46171
+ // try {
46172
+ // return await api.chatApi.updateChatRoomMember(params)
46173
+ // } catch (error: any) {
46174
+ // return thunkAPI.rejectWithValue({ error: error.response.data })
46175
+ // }
46176
+ // })
46177
+ // export const getPagingEmployeeApi = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.GET_PAGING_EMPLOYEE, async (params, thunkAPI) => {
46178
+ // try {
46179
+ // const response = await api.chatApi.getPagingEmployeeApi(params)
46180
+ // return response
46181
+ // } catch (error: any) {
46182
+ // return thunkAPI.rejectWithValue({ error: error.data })
46183
+ // }
46184
+ // })
46185
+ // export const pinMessageChatRoomApi = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.PIN_MESSAGE_CHAT_ROOM, async (params, thunkAPI) => {
46186
+ // try {
46187
+ // const response = await api.chatApi.pinMessageChatRoomApi(params)
46188
+ // return response
46189
+ // } catch (error: any) {
46190
+ // return thunkAPI.rejectWithValue({ error: error.data })
46191
+ // }
46192
+ // })
46193
+ // export const getPinMessageChatRoomApi = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.GET_PIN_MESSAGES_BY_ROOM, async (params, thunkAPI) => {
46194
+ // try {
46195
+ // const response = await api.chatApi.getPinMessagesByRoomApi(params)
46196
+ // return response
46197
+ // } catch (error: any) {
46198
+ // return thunkAPI.rejectWithValue({ error: error.data })
46199
+ // }
46200
+ // })
46201
+ // export const deletePinMessageApi = createAsyncThunk<any, string>(CHAT.ACTION_TYPES.DELETE_PIN_MESSAGE, async (pinId, thunkAPI) => {
46202
+ // try {
46203
+ // const response = await api.chatApi.deletePinMessageApi(pinId)
46204
+ // return response
46205
+ // } catch (error: any) {
46206
+ // return thunkAPI.rejectWithValue({ error: error.data })
46207
+ // }
46208
+ // })
46209
+ // export const updateGroupTagApi = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.UPDATE_GROUP_TAG, async (params, thunkAPI) => {
46210
+ // try {
46211
+ // const response = await api.chatApi.updateGroupTagApi(params)
46212
+ // return response
46213
+ // } catch (error: any) {
46214
+ // return thunkAPI.rejectWithValue({ error: error.response?.data || error.data })
46215
+ // }
46216
+ // })
46217
+ // export const createReminderApi = createAsyncThunk<any, any>(CHAT.ACTION_TYPES.CREATE_REMINDER, async (params, thunkAPI) => {
46218
+ // try {
46219
+ // const response = await api.chatApi.createReminderApi(params)
46220
+ // return response
46221
+ // } catch (error: any) {
46222
+ // return thunkAPI.rejectWithValue({ error: error.response?.data || error.data })
46223
+ // }
46224
+ // })
46237
46225
  const appChatSlice = toolkit.createSlice({
46238
46226
  name: 'appChat',
46239
46227
  initialState,
@@ -46536,59 +46524,60 @@ const appChatSlice = toolkit.createSlice({
46536
46524
  }
46537
46525
  },
46538
46526
  extraReducers: builder => {
46539
- builder.addCase(contact_add.fulfilled, (state) => {
46540
- state.checkInit = !state.checkInit;
46541
- });
46542
- builder.addCase(groups.fulfilled, (state) => {
46543
- state.checkInit = true;
46544
- });
46545
- builder.addCase(groups.pending, (state) => {
46546
- state.checkInit = false;
46547
- });
46548
- builder.addCase(groups.rejected, (state) => {
46549
- state.checkInit = false;
46550
- });
46551
- builder.addCase(addMemberGroup.fulfilled, (state) => {
46552
- state.checkInit = true;
46553
- });
46554
- builder.addCase(addMemberGroup.pending, (state) => {
46555
- state.checkInit = false;
46556
- });
46557
- builder.addCase(addMemberGroup.rejected, (state) => {
46558
- state.checkInit = false;
46559
- });
46560
- builder.addCase(get_profile.fulfilled, (state, action) => {
46561
- state.userLogin = action.payload;
46562
- });
46563
- builder.addCase(get_contact.fulfilled, (state, action) => {
46564
- state.listContact = action.payload?.items;
46565
- });
46566
- builder.addCase(update_chat_room_member.fulfilled, (state) => {
46567
- state.checkInit = !state.checkInit;
46568
- });
46569
- builder.addCase(get_history.fulfilled, (state, action) => {
46570
- state.listHistory = action.payload?.items;
46571
- });
46572
- builder.addCase(getPinMessageChatRoomApi.fulfilled, (state, action) => {
46573
- // Backend trả về danh sách PinMessage (mảng / items / data)
46574
- const payload = action.payload;
46575
- if (!payload) {
46576
- state.pinnedMessages = [];
46577
- return;
46578
- }
46579
- //debugger
46580
- let records = [];
46581
- if (Array.isArray(payload)) {
46582
- records = payload;
46583
- }
46584
- state.pinnedMessages = records
46585
- .map(mapPinRecordToMessage)
46586
- .filter((x) => !!x);
46587
- });
46588
- builder.addCase(deletePinMessageApi.fulfilled, (state, action) => {
46589
- const pinId = action.meta.arg;
46590
- state.pinnedMessages = state.pinnedMessages.filter((msg) => (msg.pinId || msg.id) !== pinId);
46591
- });
46527
+ console.log('extraReducers', builder);
46528
+ // builder.addCase(contact_add.fulfilled, (state: IFState) => {
46529
+ // state.checkInit = !state.checkInit
46530
+ // })
46531
+ // builder.addCase(groups.fulfilled, (state: IFState) => {
46532
+ // state.checkInit = true
46533
+ // })
46534
+ // builder.addCase(groups.pending, (state: IFState) => {
46535
+ // state.checkInit = false
46536
+ // })
46537
+ // builder.addCase(groups.rejected, (state: IFState) => {
46538
+ // state.checkInit = false
46539
+ // })
46540
+ // builder.addCase(addMemberGroup.fulfilled, (state: IFState) => {
46541
+ // state.checkInit = true
46542
+ // })
46543
+ // builder.addCase(addMemberGroup.pending, (state: IFState) => {
46544
+ // state.checkInit = false
46545
+ // })
46546
+ // builder.addCase(addMemberGroup.rejected, (state: IFState) => {
46547
+ // state.checkInit = false
46548
+ // })
46549
+ // builder.addCase(get_profile.fulfilled, (state: IFState, action) => {
46550
+ // state.userLogin = action.payload
46551
+ // })
46552
+ // builder.addCase(get_contact.fulfilled, (state: IFState, action) => {
46553
+ // state.listContact = action.payload?.items
46554
+ // })
46555
+ // builder.addCase(update_chat_room_member.fulfilled, (state: IFState) => {
46556
+ // state.checkInit = !state.checkInit
46557
+ // })
46558
+ // builder.addCase(get_history.fulfilled, (state: IFState, action) => {
46559
+ // state.listHistory = action.payload?.items
46560
+ // })
46561
+ // builder.addCase(getPinMessageChatRoomApi.fulfilled, (state: IFState, action) => {
46562
+ // // Backend trả về danh sách PinMessage (mảng / items / data)
46563
+ // const payload = action.payload as any
46564
+ // if (!payload) {
46565
+ // state.pinnedMessages = []
46566
+ // return
46567
+ // }
46568
+ // //debugger
46569
+ // let records: any[] = []
46570
+ // if (Array.isArray(payload)) {
46571
+ // records = payload
46572
+ // }
46573
+ // state.pinnedMessages = records
46574
+ // .map(mapPinRecordToMessage)
46575
+ // .filter((x: any) => !!x)
46576
+ // })
46577
+ // builder.addCase(deletePinMessageApi.fulfilled, (state: IFState, action) => {
46578
+ // const pinId = action.meta.arg
46579
+ // state.pinnedMessages = state.pinnedMessages.filter((msg: any) => (msg.pinId || msg.id) !== pinId)
46580
+ // })
46592
46581
  // builder.addCase(selectByGroup.fulfilled, (state: any) => {
46593
46582
  // state.checkInit = !state.checkInit
46594
46583
  // })