Skip to content

Commit 132540a

Browse files
fix typecheck
1 parent be96d62 commit 132540a

File tree

1 file changed

+9
-4
lines changed
  • apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/releases/[versionId]

1 file changed

+9
-4
lines changed

apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/releases/[versionId]/FlowPolicyNode.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ import { api } from "~/trpc/react";
3737
const ApprovalDialog: React.FC<{
3838
releaseId: string;
3939
policyId: string;
40+
userId: string;
4041
children: React.ReactNode;
41-
}> = ({ releaseId, policyId, children }) => {
42+
}> = ({ releaseId, policyId, userId, children }) => {
4243
const approve = api.environment.policy.approval.approve.useMutation();
4344
const rejected = api.environment.policy.approval.reject.useMutation();
4445
const router = useRouter();
@@ -56,15 +57,15 @@ const ApprovalDialog: React.FC<{
5657
<AlertDialogFooter>
5758
<AlertDialogCancel
5859
onClick={async () => {
59-
await rejected.mutateAsync({ releaseId, policyId });
60+
await rejected.mutateAsync({ releaseId, policyId, userId });
6061
router.refresh();
6162
}}
6263
>
6364
Reject
6465
</AlertDialogCancel>
6566
<AlertDialogAction
6667
onClick={async () => {
67-
await approve.mutateAsync({ releaseId, policyId });
68+
await approve.mutateAsync({ releaseId, policyId, userId });
6869
router.refresh();
6970
}}
7071
>
@@ -242,7 +243,11 @@ const ApprovalCheck: React.FC<PolicyNodeProps["data"]> = ({ id, release }) => {
242243
}
243244
const status = approval.data?.status;
244245
return (
245-
<ApprovalDialog policyId={id} releaseId={release.id}>
246+
<ApprovalDialog
247+
policyId={id}
248+
releaseId={release.id}
249+
userId={approval.data?.userId ?? ""}
250+
>
246251
<button
247252
disabled={status === "approved" || status === "rejected"}
248253
className="flex w-full items-center gap-2 rounded-md hover:bg-neutral-800/50"

0 commit comments

Comments
 (0)