feat: show trash for soft deleted transcripts and hard delete option (#942)

* feat: show trash for soft deleted transcripts and hard delete option

* fix: test fixtures

* docs: aws new permissions
This commit is contained in:
Juan Diego García
2026-03-31 13:15:52 -05:00
committed by GitHub
parent cc9c5cd4a5
commit ec8b49738e
20 changed files with 1351 additions and 94 deletions

View File

@@ -136,6 +136,7 @@ export function UserEventsProvider({
switch (msg.event) {
case "TRANSCRIPT_CREATED":
case "TRANSCRIPT_DELETED":
case "TRANSCRIPT_RESTORED":
case "TRANSCRIPT_STATUS":
case "TRANSCRIPT_FINAL_TITLE":
case "TRANSCRIPT_DURATION":

View File

@@ -57,6 +57,7 @@ export function useTranscriptsSearch(
offset?: number;
room_id?: string;
source_kind?: SourceKind;
include_deleted?: boolean;
} = {},
) {
return $api.useQuery(
@@ -70,6 +71,7 @@ export function useTranscriptsSearch(
offset: options.offset,
room_id: options.room_id,
source_kind: options.source_kind,
include_deleted: options.include_deleted,
},
},
},
@@ -105,6 +107,38 @@ export function useTranscriptProcess() {
});
}
export function useTranscriptRestore() {
const { setError } = useError();
const queryClient = useQueryClient();
return $api.useMutation("post", "/v1/transcripts/{transcript_id}/restore", {
onSuccess: () => {
return queryClient.invalidateQueries({
queryKey: ["get", TRANSCRIPT_SEARCH_URL],
});
},
onError: (error) => {
setError(error as Error, "There was an error restoring the transcript");
},
});
}
export function useTranscriptDestroy() {
const { setError } = useError();
const queryClient = useQueryClient();
return $api.useMutation("delete", "/v1/transcripts/{transcript_id}/destroy", {
onSuccess: () => {
return queryClient.invalidateQueries({
queryKey: ["get", TRANSCRIPT_SEARCH_URL],
});
},
onError: (error) => {
setError(error as Error, "There was an error destroying the transcript");
},
});
}
const ACTIVE_TRANSCRIPT_STATUSES = new Set<TranscriptStatus>([
"processing",
"uploaded",