Skip to content

Commit 725f33c

Browse files
feat(search): handles partial results (#6)
* feat(search): handles partial results * throws error correctly
1 parent 6313f71 commit 725f33c

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

src/stores/chat.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,6 @@ export const useChatStore = defineStore('chat', () => {
202202
return;
203203
}
204204

205-
if (sourcesStatus === 206) {
206-
// partial result
207-
hasPartialResult.value = true;
208-
}
209-
210205
if (sourcesStatus === 200 && sources === null) {
211206
chatStatus.value = CHAT_STATUS.NO_RESULTS;
212207
// no result

src/utils/fetch.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,15 @@ export const postAxios = async (
3838
options,
3939
enhancedConfig
4040
);
41+
4142
if (!(response.status >= 200) && !(response.status <= 300)) {
4243
throw new Error('Error fetching data');
4344
}
45+
4446
return response;
4547
} catch (error) {
46-
console.error(error);
47-
}
48-
const response = await axios.post(`${API_BASE}${API_VERSION}${endpoint}`, options);
49-
50-
if (!(response.status >= 200) && !(response.status <= 300)) {
5148
throw new Error('Error fetching data');
5249
}
53-
54-
return response;
5550
};
5651

5752
export const getSDGsFromQuery = async (query: string): Promise<string[]> => {

0 commit comments

Comments
 (0)