feat: support rename conversation (#1056)

This commit is contained in:
Joel 2023-08-30 17:32:32 +08:00 • committed by GitHub
commit a834ba8759
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
118 changed files with 459 additions and 16 deletions

View file

@ -73,6 +73,10 @@ export const delConversation = async (isInstalledApp: boolean, installedAppId =
return getAction('del', isInstalledApp)(getUrl(`conversations/${id}`, isInstalledApp, installedAppId))
}
export const renameConversation = async (isInstalledApp: boolean, installedAppId = '', id: string, name: string) => {
return getAction('post', isInstalledApp)(getUrl(`conversations/${id}/name`, isInstalledApp, installedAppId), { body: { name } })
}
export const fetchChatList = async (conversationId: string, isInstalledApp: boolean, installedAppId = '') => {
return getAction('get', isInstalledApp)(getUrl('messages', isInstalledApp, installedAppId), { params: { conversation_id: conversationId, limit: 20, last_id: '' } })
}

View file

@ -45,6 +45,10 @@ export const delConversation = async (id: string) => {
return del(getUrl(`conversations/${id}`))
}
export const renameConversation = async (id: string, name: string) => {
return post(getUrl(`conversations/${id}/name`), { body: { name } })
}
export const fetchChatList = async (conversationId: string) => {
return get(getUrl('messages'), { params: { conversation_id: conversationId, limit: 20, last_id: '' } })
}