Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
chronark committed Oct 13, 2024
2 parents 4764b8e + 077c791 commit b4e2e24
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
24 changes: 13 additions & 11 deletions apps/dashboard/app/(app)/apis/[apiId]/settings/delete-api.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"use client";
import { Button } from "@/components/ui/button";
import type React from "react";
import { useState } from "react";

import { Card, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { toast } from "@/components/ui/toaster";

import { Loading } from "@/components/dashboard/loading";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import { Card, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
import {
Dialog,
DialogContent,
Expand All @@ -25,13 +19,16 @@ import {
FormLabel,
FormMessage,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { cn } from "@/lib/utils";
import { zodResolver } from "@hookform/resolvers/zod";
import { useRouter } from "next/navigation";
import type React from "react";
import { useState } from "react";
import { useForm } from "react-hook-form";
import { z } from "zod";

import { cn } from "@/lib/utils";
import { revalidate } from "./actions";

type Props = {
Expand Down Expand Up @@ -84,6 +81,11 @@ export const DeleteApi: React.FC<Props> = ({ api, keys }) => {
deleteApi.mutate({ apiId: api.id });
}

function handleDialogOpenChange(newState: boolean) {
setOpen(newState);
form.reset();
}

return (
<>
<Card
Expand Down Expand Up @@ -116,7 +118,7 @@ export const DeleteApi: React.FC<Props> = ({ api, keys }) => {
) : null}
</CardFooter>
</Card>
<Dialog open={open} onOpenChange={(o) => setOpen(o)}>
<Dialog open={open} onOpenChange={handleDialogOpenChange}>
<DialogContent className="border-alert">
<DialogHeader>
<DialogTitle>Delete API</DialogTitle>
Expand Down
6 changes: 6 additions & 0 deletions oss.gg/3_follow_the_unkey_x_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ Your turn 👇
» 11-October-2024 by [Devang Rakholiya](@Devang0907)
» Link to Account: https://x.com/Devang0907

» 13-October-2024 by [Atharva Deshmukh](@atharva-3000)
» Link to Account: https://x.com/0x_atharva

» 12-October-2024 by [Saketh Pavan](@Sakethpavan)
» Link to Account: https://x.com/Sakethpavan1

---


2 changes: 1 addition & 1 deletion oss.gg/6_record_onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ Your turn 👇

////////////////////////////

» 01-October-2024 by YOUR NAME
» 10-October-2024 by Teddy ASSIH

---

0 comments on commit b4e2e24

Please sign in to comment.