@esvndev/es-react-template-chat 0.0.15 → 0.0.17
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/components/hook/index.d.ts +0 -25
- package/dist/index.js +117 -118
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +117 -118
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -46614,7 +46614,7 @@ const get_history = createAsyncThunk(CHAT.ACTION_TYPES.GET_HISTORY, async (param
|
|
|
46614
46614
|
return thunkAPI.rejectWithValue({ error: error.response.data });
|
|
46615
46615
|
}
|
|
46616
46616
|
});
|
|
46617
|
-
|
|
46617
|
+
createAsyncThunk(CHAT.ACTION_TYPES.GET_MESSAGE_BY_GROUP_CURSOR, async (params, thunkAPI) => {
|
|
46618
46618
|
try {
|
|
46619
46619
|
return await api.chatApi.getMessageByGroupCursor(params.chatRoomId, params);
|
|
46620
46620
|
}
|
|
@@ -46622,7 +46622,7 @@ const get_message_by_group_cursor = createAsyncThunk(CHAT.ACTION_TYPES.GET_MESSA
|
|
|
46622
46622
|
return thunkAPI.rejectWithValue({ error: error.response.data });
|
|
46623
46623
|
}
|
|
46624
46624
|
});
|
|
46625
|
-
|
|
46625
|
+
createAsyncThunk(CHAT.ACTION_TYPES.GET_HISTORY_ACTIVE, async (params, thunkAPI) => {
|
|
46626
46626
|
try {
|
|
46627
46627
|
return await api.chatApi.getHistoryActive(params);
|
|
46628
46628
|
}
|
|
@@ -46630,7 +46630,7 @@ const get_history_active = createAsyncThunk(CHAT.ACTION_TYPES.GET_HISTORY_ACTIVE
|
|
|
46630
46630
|
return thunkAPI.rejectWithValue({ error: error.response.data });
|
|
46631
46631
|
}
|
|
46632
46632
|
});
|
|
46633
|
-
|
|
46633
|
+
createAsyncThunk(CHAT.ACTION_TYPES.GET_INFO, async (params, thunkAPI) => {
|
|
46634
46634
|
try {
|
|
46635
46635
|
return await api.chatApi.getInfo(params);
|
|
46636
46636
|
}
|
|
@@ -46654,7 +46654,7 @@ const addMemberGroup = createAsyncThunk(CHAT.ACTION_TYPES.MEMBER_GROUP, async (p
|
|
|
46654
46654
|
return thunkAPI.rejectWithValue({ error: error.response.data });
|
|
46655
46655
|
}
|
|
46656
46656
|
});
|
|
46657
|
-
|
|
46657
|
+
createAsyncThunk(CHAT.ACTION_TYPES.SEN_MESSAGE, async (params, thunkAPI) => {
|
|
46658
46658
|
try {
|
|
46659
46659
|
return await api.chatApi.senMessage(params.id, params.formData, params.tickerDto);
|
|
46660
46660
|
}
|
|
@@ -46662,7 +46662,7 @@ const sen_message = createAsyncThunk(CHAT.ACTION_TYPES.SEN_MESSAGE, async (param
|
|
|
46662
46662
|
return thunkAPI.rejectWithValue({ error: error.response.data });
|
|
46663
46663
|
}
|
|
46664
46664
|
});
|
|
46665
|
-
|
|
46665
|
+
createAsyncThunk(CHAT.ACTION_TYPES.DELETE_MESSAGE, async (params, thunkAPI) => {
|
|
46666
46666
|
try {
|
|
46667
46667
|
return await api.chatApi.deleteMessage(params.id, params.chatRoomId);
|
|
46668
46668
|
}
|
|
@@ -46670,7 +46670,7 @@ const delete_message = createAsyncThunk(CHAT.ACTION_TYPES.DELETE_MESSAGE, async
|
|
|
46670
46670
|
return thunkAPI.rejectWithValue({ error: error.response.data });
|
|
46671
46671
|
}
|
|
46672
46672
|
});
|
|
46673
|
-
|
|
46673
|
+
createAsyncThunk(CHAT.ACTION_TYPES.RECALL_MESSAGE, async (params, thunkAPI) => {
|
|
46674
46674
|
try {
|
|
46675
46675
|
return await api.chatApi.recallMessage(params.id, params.chatRoomId);
|
|
46676
46676
|
}
|
|
@@ -46678,7 +46678,7 @@ const recall_message = createAsyncThunk(CHAT.ACTION_TYPES.RECALL_MESSAGE, async
|
|
|
46678
46678
|
return thunkAPI.rejectWithValue({ error: error.response.data });
|
|
46679
46679
|
}
|
|
46680
46680
|
});
|
|
46681
|
-
|
|
46681
|
+
createAsyncThunk(CHAT.ACTION_TYPES.UPDATE_GROUP_AVATAR, async (params, thunkAPI) => {
|
|
46682
46682
|
try {
|
|
46683
46683
|
return await api.chatApi.updateGroupAvatar(params);
|
|
46684
46684
|
}
|
|
@@ -46686,7 +46686,7 @@ const update_group_avatar = createAsyncThunk(CHAT.ACTION_TYPES.UPDATE_GROUP_AVAT
|
|
|
46686
46686
|
return thunkAPI.rejectWithValue({ error: error.response.data });
|
|
46687
46687
|
}
|
|
46688
46688
|
});
|
|
46689
|
-
|
|
46689
|
+
createAsyncThunk(CHAT.ACTION_TYPES.GET_MESSAGE_BY_GROUP, async (params, thunkAPI) => {
|
|
46690
46690
|
try {
|
|
46691
46691
|
return await api.chatApi.getMessageByGroup(params.chatRoomId, params.paging);
|
|
46692
46692
|
}
|
|
@@ -46694,7 +46694,7 @@ const get_message_by_group = createAsyncThunk(CHAT.ACTION_TYPES.GET_MESSAGE_BY_G
|
|
|
46694
46694
|
return thunkAPI.rejectWithValue({ error: error.response.data });
|
|
46695
46695
|
}
|
|
46696
46696
|
});
|
|
46697
|
-
|
|
46697
|
+
createAsyncThunk(CHAT.ACTION_TYPES.GET_MESSAGE_BY_CONTACT, async (params, thunkAPI) => {
|
|
46698
46698
|
try {
|
|
46699
46699
|
return await api.chatApi.getMessageByContact(params.chatRoomId, params.paging);
|
|
46700
46700
|
}
|
|
@@ -46710,7 +46710,7 @@ const contact_add = createAsyncThunk(CHAT.ACTION_TYPES.CONTACT_ADD, async (param
|
|
|
46710
46710
|
return thunkAPI.rejectWithValue({ error: error.response.data });
|
|
46711
46711
|
}
|
|
46712
46712
|
});
|
|
46713
|
-
|
|
46713
|
+
createAsyncThunk(CHAT.ACTION_TYPES.CONNECT_CHAT_ROOM_MEMBER, async (params, thunkAPI) => {
|
|
46714
46714
|
try {
|
|
46715
46715
|
return await api.chatApi.connectChatRoomMemberApi(params);
|
|
46716
46716
|
}
|
|
@@ -46726,7 +46726,7 @@ const get_profile = createAsyncThunk(CHAT.ACTION_TYPES.GET_PROFILE, async (_, th
|
|
|
46726
46726
|
return thunkAPI.rejectWithValue({ error: error.response.data });
|
|
46727
46727
|
}
|
|
46728
46728
|
});
|
|
46729
|
-
|
|
46729
|
+
createAsyncThunk(CHAT.ACTION_TYPES.GET_USERS, async (params, thunkAPI) => {
|
|
46730
46730
|
try {
|
|
46731
46731
|
return await api.chatApi.getUsers(params);
|
|
46732
46732
|
}
|
|
@@ -46750,7 +46750,7 @@ const update_chat_room_member = createAsyncThunk(CHAT.ACTION_TYPES.CHAT_ROOM_MEM
|
|
|
46750
46750
|
return thunkAPI.rejectWithValue({ error: error.response.data });
|
|
46751
46751
|
}
|
|
46752
46752
|
});
|
|
46753
|
-
|
|
46753
|
+
createAsyncThunk(CHAT.ACTION_TYPES.GET_PAGING_EMPLOYEE, async (params, thunkAPI) => {
|
|
46754
46754
|
try {
|
|
46755
46755
|
const response = await api.chatApi.getPagingEmployeeApi(params);
|
|
46756
46756
|
return response;
|
|
@@ -46759,7 +46759,7 @@ const getPagingEmployeeApi = createAsyncThunk(CHAT.ACTION_TYPES.GET_PAGING_EMPLO
|
|
|
46759
46759
|
return thunkAPI.rejectWithValue({ error: error.data });
|
|
46760
46760
|
}
|
|
46761
46761
|
});
|
|
46762
|
-
|
|
46762
|
+
createAsyncThunk(CHAT.ACTION_TYPES.PIN_MESSAGE_CHAT_ROOM, async (params, thunkAPI) => {
|
|
46763
46763
|
try {
|
|
46764
46764
|
const response = await api.chatApi.pinMessageChatRoomApi(params);
|
|
46765
46765
|
return response;
|
|
@@ -46786,7 +46786,7 @@ const deletePinMessageApi = createAsyncThunk(CHAT.ACTION_TYPES.DELETE_PIN_MESSAG
|
|
|
46786
46786
|
return thunkAPI.rejectWithValue({ error: error.data });
|
|
46787
46787
|
}
|
|
46788
46788
|
});
|
|
46789
|
-
|
|
46789
|
+
createAsyncThunk(CHAT.ACTION_TYPES.UPDATE_GROUP_TAG, async (params, thunkAPI) => {
|
|
46790
46790
|
try {
|
|
46791
46791
|
const response = await api.chatApi.updateGroupTagApi(params);
|
|
46792
46792
|
return response;
|
|
@@ -46795,7 +46795,7 @@ const updateGroupTagApi = createAsyncThunk(CHAT.ACTION_TYPES.UPDATE_GROUP_TAG, a
|
|
|
46795
46795
|
return thunkAPI.rejectWithValue({ error: error.response?.data || error.data });
|
|
46796
46796
|
}
|
|
46797
46797
|
});
|
|
46798
|
-
|
|
46798
|
+
createAsyncThunk(CHAT.ACTION_TYPES.CREATE_REMINDER, async (params, thunkAPI) => {
|
|
46799
46799
|
try {
|
|
46800
46800
|
const response = await api.chatApi.createReminderApi(params);
|
|
46801
46801
|
return response;
|
|
@@ -47167,91 +47167,90 @@ const appChatSlice = createSlice({
|
|
|
47167
47167
|
// })
|
|
47168
47168
|
}
|
|
47169
47169
|
});
|
|
47170
|
-
|
|
47171
|
-
//setGetHistory,
|
|
47172
|
-
getNotification, removeChatRoom, setListChatType, setArchive, setApproveStatus, setHistory, editGroupName, setScroll, updateMemberGroup, setMessageByGroup, leaveGroup, getGeneralGroup, setGeneralGroup, editGroupAvatar, editGroupTag, addPinnedMessage, userTyping } = appChatSlice.actions;
|
|
47170
|
+
appChatSlice.actions;
|
|
47173
47171
|
|
|
47174
47172
|
const useChat = () => {
|
|
47175
47173
|
const dispatch = useAppDispatch();
|
|
47176
47174
|
const { active, checkInit, chatRoomId, userLogin, listContact, contactId, typeChat, loadChat, messageByGroup, listHistory, listChatType, archiveStore, checkScroll, listGeneralGroup, pinnedMessages, typingUsers } = useAppSelector((state) => state.chat);
|
|
47175
|
+
console.log('active', active);
|
|
47177
47176
|
const getHistoryApi = (params) => {
|
|
47178
47177
|
return dispatch(get_history(params));
|
|
47179
47178
|
};
|
|
47180
|
-
const get_message_by_group_cursor_api = (params) => {
|
|
47181
|
-
|
|
47182
|
-
}
|
|
47183
|
-
const getHistoryActiveApi = (params) => {
|
|
47184
|
-
|
|
47185
|
-
}
|
|
47186
|
-
const getInfoApi = (params) => {
|
|
47187
|
-
|
|
47188
|
-
}
|
|
47189
|
-
const getMessageByGroupApi = (params, paging) => {
|
|
47190
|
-
|
|
47191
|
-
}
|
|
47192
|
-
const getMessageByContactApi = (params, paging) => {
|
|
47193
|
-
|
|
47194
|
-
}
|
|
47195
|
-
const groupsApi = (params) => {
|
|
47196
|
-
|
|
47197
|
-
}
|
|
47198
|
-
const addMemberGroup
|
|
47199
|
-
|
|
47200
|
-
}
|
|
47201
|
-
const senMessageApi = (id, params) => {
|
|
47202
|
-
|
|
47203
|
-
}
|
|
47204
|
-
const deleteMessageApi = (params) => {
|
|
47205
|
-
|
|
47206
|
-
}
|
|
47207
|
-
const recallMessageApi = (params) => {
|
|
47208
|
-
|
|
47209
|
-
}
|
|
47210
|
-
const contactAddApi = (params) => {
|
|
47211
|
-
|
|
47212
|
-
}
|
|
47213
|
-
const updateGroupAvatarApi = (params) => {
|
|
47214
|
-
|
|
47215
|
-
}
|
|
47216
|
-
const getProfileApi = () => {
|
|
47217
|
-
|
|
47218
|
-
}
|
|
47219
|
-
const getUsersApi = (params) => {
|
|
47220
|
-
|
|
47221
|
-
}
|
|
47222
|
-
const getContactApi = (params) => {
|
|
47223
|
-
|
|
47224
|
-
}
|
|
47225
|
-
const updateChatRoomMemberApi = (params) => {
|
|
47226
|
-
|
|
47227
|
-
}
|
|
47228
|
-
const setScroll
|
|
47229
|
-
|
|
47230
|
-
}
|
|
47231
|
-
const setGeneralGroup
|
|
47232
|
-
|
|
47233
|
-
}
|
|
47234
|
-
const getPagingEmployeeApi
|
|
47235
|
-
|
|
47236
|
-
}
|
|
47237
|
-
const connectChatRoomMember = (params) => {
|
|
47238
|
-
|
|
47239
|
-
}
|
|
47240
|
-
const pinMessageChatRoom = (params) => {
|
|
47241
|
-
|
|
47242
|
-
}
|
|
47243
|
-
const getPinMessageChatRoomApi
|
|
47244
|
-
|
|
47245
|
-
}
|
|
47246
|
-
const deletePinMessage = (pinId) => {
|
|
47247
|
-
|
|
47248
|
-
}
|
|
47249
|
-
const updateGroupTagApi
|
|
47250
|
-
|
|
47251
|
-
}
|
|
47252
|
-
const createReminderApi
|
|
47253
|
-
|
|
47254
|
-
}
|
|
47179
|
+
// const get_message_by_group_cursor_api = (params: any) => {
|
|
47180
|
+
// return dispatch(chatStore.get_message_by_group_cursor(params))
|
|
47181
|
+
// }
|
|
47182
|
+
// const getHistoryActiveApi = (params: any) => {
|
|
47183
|
+
// return dispatch(chatStore.get_history_active(params))
|
|
47184
|
+
// }
|
|
47185
|
+
// const getInfoApi = (params: any) => {
|
|
47186
|
+
// return dispatch(chatStore.get_info(params))
|
|
47187
|
+
// }
|
|
47188
|
+
// const getMessageByGroupApi = (params: any, paging: any) => {
|
|
47189
|
+
// return dispatch(chatStore.get_message_by_group({ chatRoomId: params, paging }))
|
|
47190
|
+
// }
|
|
47191
|
+
// const getMessageByContactApi = (params: string, paging: any) => {
|
|
47192
|
+
// return dispatch(chatStore.get_message_by_contact({ chatRoomId: params, paging }))
|
|
47193
|
+
// }
|
|
47194
|
+
// const groupsApi = (params: any) => {
|
|
47195
|
+
// return dispatch(chatStore.groups(params))
|
|
47196
|
+
// }
|
|
47197
|
+
// const addMemberGroup = (params: any) => {
|
|
47198
|
+
// return dispatch(chatStore.addMemberGroup(params))
|
|
47199
|
+
// }
|
|
47200
|
+
// const senMessageApi = (id: string, params: any) => {
|
|
47201
|
+
// return dispatch(chatStore.sen_message({ id, formData: params }))
|
|
47202
|
+
// }
|
|
47203
|
+
// const deleteMessageApi = (params: any) => {
|
|
47204
|
+
// return dispatch(chatStore.delete_message(params))
|
|
47205
|
+
// }
|
|
47206
|
+
// const recallMessageApi = (params: any) => {
|
|
47207
|
+
// return dispatch(chatStore.recall_message(params))
|
|
47208
|
+
// }
|
|
47209
|
+
// const contactAddApi = (params: any) => {
|
|
47210
|
+
// return dispatch(chatStore.contact_add(params))
|
|
47211
|
+
// }
|
|
47212
|
+
// const updateGroupAvatarApi = (params: any) => {
|
|
47213
|
+
// return dispatch(chatStore.update_group_avatar(params))
|
|
47214
|
+
// }
|
|
47215
|
+
// const getProfileApi = () => {
|
|
47216
|
+
// return dispatch(chatStore.get_profile())
|
|
47217
|
+
// }
|
|
47218
|
+
// const getUsersApi = (params: any) => {
|
|
47219
|
+
// return dispatch(chatStore.get_users(params))
|
|
47220
|
+
// }
|
|
47221
|
+
// const getContactApi = (params: any) => {
|
|
47222
|
+
// return dispatch(chatStore.get_contact(params))
|
|
47223
|
+
// }
|
|
47224
|
+
// const updateChatRoomMemberApi = (params: any) => {
|
|
47225
|
+
// return dispatch(chatStore.update_chat_room_member(params))
|
|
47226
|
+
// }
|
|
47227
|
+
// const setScroll = (params: any) => {
|
|
47228
|
+
// return dispatch(chatStore.setScroll(params))
|
|
47229
|
+
// }
|
|
47230
|
+
// const setGeneralGroup = (params: any) => {
|
|
47231
|
+
// return dispatch(chatStore.setGeneralGroup(params))
|
|
47232
|
+
// }
|
|
47233
|
+
// const getPagingEmployeeApi = (params: any) => {
|
|
47234
|
+
// return dispatch(chatStore.getPagingEmployeeApi(params))
|
|
47235
|
+
// }
|
|
47236
|
+
// const connectChatRoomMember = (params: any) => {
|
|
47237
|
+
// return dispatch(chatStore.connectChatRoomMemberApi(params))
|
|
47238
|
+
// }
|
|
47239
|
+
// const pinMessageChatRoom = (params: any) => {
|
|
47240
|
+
// return dispatch(chatStore.pinMessageChatRoomApi(params))
|
|
47241
|
+
// }
|
|
47242
|
+
// const getPinMessageChatRoomApi = (params: any) => {
|
|
47243
|
+
// return dispatch(chatStore.getPinMessageChatRoomApi(params))
|
|
47244
|
+
// }
|
|
47245
|
+
// const deletePinMessage = (pinId: string) => {
|
|
47246
|
+
// return dispatch(chatStore.deletePinMessageApi(pinId))
|
|
47247
|
+
// }
|
|
47248
|
+
// const updateGroupTagApi = (params: any) => {
|
|
47249
|
+
// return dispatch(chatStore.updateGroupTagApi(params))
|
|
47250
|
+
// }
|
|
47251
|
+
// const createReminderApi = (params: any) => {
|
|
47252
|
+
// return dispatch(chatStore.createReminderApi(params))
|
|
47253
|
+
// }
|
|
47255
47254
|
return {
|
|
47256
47255
|
active,
|
|
47257
47256
|
contactId,
|
|
@@ -47269,31 +47268,31 @@ const useChat = () => {
|
|
|
47269
47268
|
checkScroll,
|
|
47270
47269
|
listGeneralGroup,
|
|
47271
47270
|
getHistoryApi,
|
|
47272
|
-
getInfoApi,
|
|
47273
|
-
getMessageByGroupApi,
|
|
47274
|
-
getMessageByContactApi,
|
|
47275
|
-
groupsApi,
|
|
47276
|
-
|
|
47277
|
-
senMessageApi,
|
|
47278
|
-
deleteMessageApi,
|
|
47279
|
-
recallMessageApi,
|
|
47280
|
-
contactAddApi,
|
|
47281
|
-
updateGroupAvatarApi,
|
|
47282
|
-
getProfileApi,
|
|
47283
|
-
getUsersApi,
|
|
47284
|
-
getContactApi,
|
|
47285
|
-
getHistoryActiveApi,
|
|
47286
|
-
updateChatRoomMemberApi,
|
|
47287
|
-
|
|
47288
|
-
|
|
47289
|
-
get_message_by_group_cursor_api,
|
|
47290
|
-
|
|
47291
|
-
connectChatRoomMember,
|
|
47292
|
-
pinMessageChatRoom,
|
|
47293
|
-
|
|
47294
|
-
deletePinMessage,
|
|
47295
|
-
|
|
47296
|
-
|
|
47271
|
+
// getInfoApi,
|
|
47272
|
+
// getMessageByGroupApi,
|
|
47273
|
+
// getMessageByContactApi,
|
|
47274
|
+
// groupsApi,
|
|
47275
|
+
// addMemberGroup,
|
|
47276
|
+
// senMessageApi,
|
|
47277
|
+
// deleteMessageApi,
|
|
47278
|
+
// recallMessageApi,
|
|
47279
|
+
// contactAddApi,
|
|
47280
|
+
// updateGroupAvatarApi,
|
|
47281
|
+
// getProfileApi,
|
|
47282
|
+
// getUsersApi,
|
|
47283
|
+
// getContactApi,
|
|
47284
|
+
// getHistoryActiveApi,
|
|
47285
|
+
// updateChatRoomMemberApi,
|
|
47286
|
+
// setScroll,
|
|
47287
|
+
// setGeneralGroup,
|
|
47288
|
+
// get_message_by_group_cursor_api,
|
|
47289
|
+
// getPagingEmployeeApi,
|
|
47290
|
+
// connectChatRoomMember,
|
|
47291
|
+
// pinMessageChatRoom,
|
|
47292
|
+
// getPinMessageChatRoomApi,
|
|
47293
|
+
// deletePinMessage,
|
|
47294
|
+
// updateGroupTagApi,
|
|
47295
|
+
// createReminderApi,
|
|
47297
47296
|
typingUsers
|
|
47298
47297
|
};
|
|
47299
47298
|
};
|