feat: connect inbox confirmation workflow
This commit is contained in:
@@ -12,6 +12,7 @@ export type InboxItemDTO = {
|
||||
}
|
||||
|
||||
export type InboxSuggestionDTO = {
|
||||
id: string
|
||||
kind: 'task' | 'note' | 'source'
|
||||
title: string
|
||||
body: string
|
||||
@@ -21,6 +22,10 @@ export type AnalyzeInboxResponseDTO = {
|
||||
suggestions: InboxSuggestionDTO[]
|
||||
}
|
||||
|
||||
export type ConfirmInboxResponseDTO = {
|
||||
createdCount: number
|
||||
}
|
||||
|
||||
export type CaptureInboxInput = {
|
||||
sourceType: string
|
||||
title: string
|
||||
@@ -42,11 +47,10 @@ export async function analyzeInboxItem(session: ApiSession, inboxId: string) {
|
||||
})
|
||||
}
|
||||
|
||||
export async function confirmInboxItem(session: ApiSession, inboxId: string, suggestions: InboxSuggestionDTO[]) {
|
||||
return apiRequest<void>(`/api/v1/inbox/${inboxId}/confirm`, {
|
||||
export async function confirmInboxItem(session: ApiSession, inboxId: string, suggestionIds: string[]) {
|
||||
return apiRequest<ConfirmInboxResponseDTO>(`/api/v1/inbox/${inboxId}/confirm`, {
|
||||
method: 'POST',
|
||||
token: session.token,
|
||||
body: { suggestions },
|
||||
responseType: 'void',
|
||||
body: { suggestionIds },
|
||||
})
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ export function mapWorkspace(payload: ProjectWorkspaceDTO, index = 0): ProjectWo
|
||||
|
||||
return {
|
||||
project,
|
||||
channels: payload.channels.filter((channel) => channel.type !== 'inbox').map(mapChannel),
|
||||
channels: payload.channels.map(mapChannel),
|
||||
tags: payload.tags.map((tag) => tag.name),
|
||||
recentSessions: payload.recentSessions.map(mapAISession),
|
||||
inbox: payload.inbox.map(mapInbox),
|
||||
|
||||
Reference in New Issue
Block a user