feat: support rename conversation (#1056)

This commit is contained in:
Joel
2023-08-30 17:32:32 +08:00
committed by GitHub
parent c67f345d0e
commit a834ba8759
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: '' } })
}