feat(web): update composable and service

- useNavigation.js: update navigation composable
- services/orchestrator.js: update orchestrator service client
This commit is contained in:
caoxiaozhu
2026-05-13 13:14:17 +00:00
parent eec4efe207
commit 778d203443
2 changed files with 22 additions and 6 deletions

View File

@@ -7,20 +7,36 @@ export function runOrchestrator(payload) {
})
}
export function fetchLatestConversation(userId) {
export function fetchLatestConversation(userId, sessionType = '') {
const params = new URLSearchParams({
user_id: String(userId || '').trim()
})
if (String(sessionType || '').trim()) {
params.set('session_type', String(sessionType || '').trim())
}
return apiRequest(`/orchestrator/conversations/latest?${params.toString()}`)
}
export function clearUserConversations(userId) {
export function clearUserConversations(userId, sessionType = '') {
const params = new URLSearchParams({
user_id: String(userId || '').trim()
})
if (String(sessionType || '').trim()) {
params.set('session_type', String(sessionType || '').trim())
}
return apiRequest(`/orchestrator/conversations?${params.toString()}`, {
method: 'DELETE'
})
}
export function deleteConversation(conversationId, userId) {
const params = new URLSearchParams({
user_id: String(userId || '').trim()
})
return apiRequest(`/orchestrator/conversations/${encodeURIComponent(String(conversationId || '').trim())}?${params.toString()}`, {
method: 'DELETE'
})
}