Skip to content

Commit

Permalink
fixup! Merge branch 'main' into morgan/cal-4183-eventtypeatom-web-wra…
Browse files Browse the repository at this point in the history
…pper-base
  • Loading branch information
ThyMinimalDev committed Sep 18, 2024
1 parent 296c4d7 commit ab23397
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/features/eventtypes/components/EventType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const EventType = (
onDelete: () => void;
onConflict: (eventTypes: ChildrenEventType[]) => void;
children?: React.ReactNode;
handleSubmit: () => void;
handleSubmit: (values: FormValues) => void;
formMethods: UseFormReturn<FormValues>;
eventTypeApps?: EventTypeApps;
isUpdating: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ export const useEventTypeForm = ({
return updatedFields;
};

const handleSubmit = async () => {
const values = form.getValues();
const handleSubmit = async (values: FormValues) => {
const { children } = values;
const dirtyValues = getDirtyFields(values);
const dirtyFieldExists = Object.keys(dirtyValues).length !== 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const EventTypePageWrapper = ({ id, ...rest }: EventTypeSetupProps & { id: numbe

const EventTypeAppWrapper = ({ id, ...rest }: EventTypeSetupProps & { id: number }) => {
const pathname = usePathname();
return <EventTypeWeb {...rest} id={id} isAppDir={true} pathname={pathname} pageRouter={null} />;
return <EventTypeWeb {...rest} id={id} isAppDir={true} pathname={pathname ?? ""} pageRouter={null} />;
};

const EventTypeWeb = ({
Expand Down Expand Up @@ -330,7 +330,7 @@ const EventTypeWeb = ({
slug={slug}
onConfirm={(e: { preventDefault: () => void }) => {
e.preventDefault();
handleSubmit();
handleSubmit(form.getValues());
telemetry.event(telemetryEventTypes.slugReplacementAction);
setSlugExistsChildrenDialogOpen([]);
}}
Expand Down

0 comments on commit ab23397

Please sign in to comment.