mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Unified API response json schema (#3170)
### What problem does this PR solve? Unified API response json schema ### Type of change - [x] Refactoring
This commit is contained in:
@ -176,7 +176,7 @@ export const useEditDialog = () => {
|
||||
async (dialogId?: string) => {
|
||||
if (dialogId) {
|
||||
const ret = await fetchDialog(dialogId);
|
||||
if (ret.retcode === 0) {
|
||||
if (ret.code === 0) {
|
||||
setDialog(ret.data);
|
||||
}
|
||||
}
|
||||
@ -393,7 +393,7 @@ export const useSendNextMessage = (controller: AbortController) => {
|
||||
controller,
|
||||
);
|
||||
|
||||
if (res && (res?.response.status !== 200 || res?.data?.retcode !== 0)) {
|
||||
if (res && (res?.response.status !== 200 || res?.data?.code !== 0)) {
|
||||
// cancel loading
|
||||
setValue(message.content);
|
||||
console.info('removeLatestMessage111');
|
||||
@ -421,7 +421,7 @@ export const useSendNextMessage = (controller: AbortController) => {
|
||||
true,
|
||||
conversationId,
|
||||
);
|
||||
if (data.retcode === 0) {
|
||||
if (data.code === 0) {
|
||||
setConversationIsNew('');
|
||||
const id = data.data.id;
|
||||
// currentConversationIdRef.current = id;
|
||||
@ -541,7 +541,7 @@ export const useRenameConversation = () => {
|
||||
is_new: false,
|
||||
});
|
||||
|
||||
if (ret.retcode === 0) {
|
||||
if (ret.code === 0) {
|
||||
hideConversationRenameModal();
|
||||
}
|
||||
},
|
||||
@ -551,7 +551,7 @@ export const useRenameConversation = () => {
|
||||
const handleShowConversationRenameModal = useCallback(
|
||||
async (conversationId: string) => {
|
||||
const ret = await fetchConversation(conversationId);
|
||||
if (ret.retcode === 0) {
|
||||
if (ret.code === 0) {
|
||||
setConversation(ret.data);
|
||||
}
|
||||
showConversationRenameModal();
|
||||
|
||||
Reference in New Issue
Block a user