Skip to content

Commit

Permalink
Rename search param
Browse files Browse the repository at this point in the history
  • Loading branch information
elie222 committed Dec 21, 2024
1 parent ec8b51c commit 8b0f598
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion apps/web/app/(app)/automation/group/Groups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
import type { GroupsResponse } from "@/app/api/user/group/route";
import { CreateGroupModalButton } from "@/app/(app)/automation/group/CreateGroupModal";
import { Button } from "@/components/ui/button";
import { RuleType } from "@prisma/client";

export function Groups() {
const { data, isLoading, error } = useSWR<GroupsResponse>("/api/user/group");
Expand Down Expand Up @@ -97,7 +98,7 @@ function GroupTable({ groups }: { groups: GroupsResponse["groups"] }) {
) : (
<Button variant="outline" size="sm" asChild>
<Link
href={`/automation/rule/create?groupId=${group.id}&tab=GROUP`}
href={`/automation/rule/create?groupId=${group.id}&type=${RuleType.GROUP}`}
>
Attach
</Link>
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/(app)/automation/group/ViewGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import {
updateGroupPromptAction,
} from "@/utils/actions/group";
import { GroupName } from "@/utils/config";
import { GroupItemType } from "@prisma/client";
import { GroupItemType, RuleType } from "@prisma/client";
import { Input } from "@/components/Input";
import { Select } from "@/components/Select";
import { zodResolver } from "@hookform/resolvers/zod";
Expand Down Expand Up @@ -133,7 +133,7 @@ export function ViewGroup({
) : (
<Button variant="outline" asChild className="w-full sm:w-auto">
<Link
href={`/automation/rule/create?groupId=${groupId}&tab=GROUP`}
href={`/automation/rule/create?groupId=${groupId}&type=${RuleType.GROUP}`}
>
Attach Rule
</Link>
Expand Down
10 changes: 4 additions & 6 deletions apps/web/app/(app)/automation/rule/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function CreateRulePage({
searchParams: {
example?: string;
groupId?: string;
tab?: RuleType;
type?: RuleType;
categoryId?: string;
label?: string;
};
Expand All @@ -28,16 +28,14 @@ export default function CreateRulePage({
? [
{
type: ActionType.LABEL,
label: {
value: searchParams.label,
},
label: { value: searchParams.label },
},
]
: [],
conditions: searchParams.tab
conditions: searchParams.type
? [
getEmptyCondition(
searchParams.tab,
searchParams.type,
searchParams.groupId,
searchParams.categoryId,
),
Expand Down

1 comment on commit 8b0f598

@vercel
Copy link

@vercel vercel bot commented on 8b0f598 Dec 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.