Skip to content

Commit

Permalink
fix typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyblasczyk committed Oct 25, 2024
1 parent be96d62 commit 132540a
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ import { api } from "~/trpc/react";
const ApprovalDialog: React.FC<{
releaseId: string;
policyId: string;
userId: string;
children: React.ReactNode;
}> = ({ releaseId, policyId, children }) => {
}> = ({ releaseId, policyId, userId, children }) => {
const approve = api.environment.policy.approval.approve.useMutation();
const rejected = api.environment.policy.approval.reject.useMutation();
const router = useRouter();
Expand All @@ -56,15 +57,15 @@ const ApprovalDialog: React.FC<{
<AlertDialogFooter>
<AlertDialogCancel
onClick={async () => {
await rejected.mutateAsync({ releaseId, policyId });
await rejected.mutateAsync({ releaseId, policyId, userId });
router.refresh();
}}
>
Reject
</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
await approve.mutateAsync({ releaseId, policyId });
await approve.mutateAsync({ releaseId, policyId, userId });
router.refresh();
}}
>
Expand Down Expand Up @@ -242,7 +243,11 @@ const ApprovalCheck: React.FC<PolicyNodeProps["data"]> = ({ id, release }) => {
}
const status = approval.data?.status;
return (
<ApprovalDialog policyId={id} releaseId={release.id}>
<ApprovalDialog
policyId={id}
releaseId={release.id}
userId={approval.data?.userId ?? ""}
>
<button
disabled={status === "approved" || status === "rejected"}
className="flex w-full items-center gap-2 rounded-md hover:bg-neutral-800/50"
Expand Down

0 comments on commit 132540a

Please sign in to comment.