open a draft chat and create it on the first message

"Написать" now looks up an existing chat for the ad (GET, never creates).
If there is none it opens /chats/new as a draft with the ad in the header;
the first send calls POST /chats/with/{userId}/messages, which creates the
chat with that message, and the page switches to /chats/{id}. Reloading
/chats/new without draft data goes back to the chat list.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
SlimusMinus
2026-10-13 01:45:21 +03:00
parent e26283f907
commit 08f3a7e2bb
4 changed files with 94 additions and 31 deletions

View File

@@ -60,6 +60,7 @@ function App() {
<Route path="/feed" element={<MainFeed />} />
<Route path="/reviews" element={<ReviewsPage />} />
<Route path="/chats" element={<ChatListPage />} />
<Route path="/chats/new" element={<ChatPage />} />
<Route path="/chats/:chatId" element={<ChatPage />} />
<Route path="/admin/ads" element={<AdminRoute><AdminAdsPage /></AdminRoute>} />
<Route path="*" element={<LandingPage />} />