Skip to content

Commit

Permalink
Whishper delete button is hard
Browse files Browse the repository at this point in the history
  • Loading branch information
aamirazad committed Jul 10, 2024
1 parent 20df473 commit ddd7b86
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export async function DELETE(req: Request) {
return new Response("Unauthorized", { status: 401 });
}

console.log(getWhishperRecordings(name));

const response = await fetch(
`${userData.whishperURL}/api/transcriptions/${name}`,
{
Expand Down
13 changes: 12 additions & 1 deletion src/components/audio-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip";
import { useState } from "react";
import { getWhishperRecordings } from "@/app/whishper/page";

const queryClient = new QueryClient();

Expand Down Expand Up @@ -57,6 +58,8 @@ function AudioInfo(props: { name: string }) {
const router = useRouter();
const [isPlaying, setIsPlaying] = useState(false);

console.log(getWhishperRecordings(props.name));

const {
data: userData,
isLoading: isUserDataLoading,
Expand Down Expand Up @@ -143,7 +146,15 @@ function AudioInfo(props: { name: string }) {
tabIndex={-1}
className="cursor-not-allowed opacity-50"
>
<Button className="w-24" variant="destructive">
<Button
className="w-24"
variant="destructive"
onClick={() => {
fetch("/api/deleteWhishperRecording" + id, {
method: "DELETE",
});
}}
>
Delete
</Button>
</TooltipTrigger>
Expand Down
3 changes: 3 additions & 0 deletions src/components/document-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ function DocumentViewer(props: { id: number }) {
>
Open
</OpenExternalLink>
<Button className="mr-2 w-24" variant="destructive">
Delete
</Button>
</div>
</div>
</div>
Expand Down

0 comments on commit ddd7b86

Please sign in to comment.