make modal update after submission with default values
This commit is contained in:
parent
ac8250c1c4
commit
d55f54ae86
@ -83,7 +83,11 @@ const LinkModal = ({
|
|||||||
setOpen: Dispatch<SetStateAction<boolean>>;
|
setOpen: Dispatch<SetStateAction<boolean>>;
|
||||||
}) => {
|
}) => {
|
||||||
const { setValue, getValues } = useFormContext<ResourceUpdateInput>();
|
const { setValue, getValues } = useFormContext<ResourceUpdateInput>();
|
||||||
const { register, handleSubmit } = useForm<PlatformLink>();
|
const {
|
||||||
|
register,
|
||||||
|
handleSubmit,
|
||||||
|
setValue: setLocalFormValue,
|
||||||
|
} = useForm<PlatformLink>();
|
||||||
const platformTypeOptions = [
|
const platformTypeOptions = [
|
||||||
{
|
{
|
||||||
label: "Website",
|
label: "Website",
|
||||||
@ -109,6 +113,8 @@ const LinkModal = ({
|
|||||||
values.push(data);
|
values.push(data);
|
||||||
setValue("platform_links", values);
|
setValue("platform_links", values);
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
|
setLocalFormValue("platform", Platform.WEBSITE);
|
||||||
|
setLocalFormValue("link", "");
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user