Commit 34b75d1
authored
Fix chat endpoint (#23)
This pull request includes several improvements and new features for the chat functionality in the `ChatContainer` component and related services. The most important changes include adding support for handling `chatUuid` in the payload and response headers, and updating the API endpoints. Enhancements to `ChatContainer` component: * [`src/components/ChatContainer/ChatContainer.tsx`](diffhunk://#diff-c0bfccaf03a29a5059f6a47c6dd2cdd194fcb1e06fe8e0e188d700a86204f073R167-R171): Added support for including `chatUuid` in the payload if available and setting `chatUuid` from response headers if not already set. [[1]](diffhunk://#diff-c0bfccaf03a29a5059f6a47c6dd2cdd194fcb1e06fe8e0e188d700a86204f073R167-R171) [[2]](diffhunk://#diff-c0bfccaf03a29a5059f6a47c6dd2cdd194fcb1e06fe8e0e188d700a86204f073R217-R221) Updates to `APIClient` and `ChatService`: * [`src/services/APIClient.ts`](diffhunk://#diff-c541918b610d84d9d4591faecad3008e1a8a244d446b8b929f3e017ea97fd558L57-R61): Modified the `fetch` method to merge custom headers with default headers and enabled CORS mode. * [`src/services/ChatService.ts`](diffhunk://#diff-9dd13b51c673219aa9d6fb02c8bc1100134172df11c9c69008b0b299c0b3d53fL43-R43): Updated the `sendMessage` method to use the new API endpoint `/api/v1/chats`. * [`src/services/ChatService.ts`](diffhunk://#diff-9dd13b51c673219aa9d6fb02c8bc1100134172df11c9c69008b0b299c0b3d53fL55-R78): Enhanced the `sendStreamMessage` method to handle `chatUuid` from response headers and added debug logging for all response headers.1 parent bd96ed4 commit 34b75d1
File tree
3 files changed
+33
-3
lines changed- src
- components/ChatContainer
- services
3 files changed
+33
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
167 | 172 | | |
168 | 173 | | |
169 | 174 | | |
| |||
209 | 214 | | |
210 | 215 | | |
211 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
212 | 222 | | |
213 | 223 | | |
214 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
63 | 79 | | |
64 | 80 | | |
65 | 81 | | |
| |||
0 commit comments