Skip to content

Commit c8e885a

Browse files
committed
fix feedback
1 parent 13737d7 commit c8e885a

File tree

10 files changed

+914
-943
lines changed

10 files changed

+914
-943
lines changed

apps/dashboard/src/@/api/support.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ interface CreateSupportTicketRequest {
2727
message: string;
2828
teamSlug: string;
2929
title: string;
30+
conversationId?: string;
3031
}
3132

3233
interface SendMessageRequest {
@@ -279,6 +280,31 @@ export async function createSupportTicket(
279280
}
280281

281282
const createdConversation: SupportTicket = await response.json();
283+
284+
// Escalate to SIWA feedback endpoint if conversationId is provided
285+
if (request.conversationId) {
286+
try {
287+
const siwaUrl = process.env.NEXT_PUBLIC_SIWA_URL;
288+
if (siwaUrl) {
289+
await fetch(`${siwaUrl}/v1/chat/feedback`, {
290+
method: "POST",
291+
headers: {
292+
"Content-Type": "application/json",
293+
Authorization: `Bearer ${token}`,
294+
...(request.teamSlug ? { "x-team-id": request.teamSlug } : {}),
295+
},
296+
body: JSON.stringify({
297+
conversationId: request.conversationId,
298+
feedbackRating: 9999,
299+
}),
300+
});
301+
}
302+
} catch (error) {
303+
// Log error but don't fail the ticket creation
304+
console.error("Failed to escalate to SIWA feedback:", error);
305+
}
306+
}
307+
282308
return createdConversation;
283309
}
284310

0 commit comments

Comments
 (0)