fix(widgets): refresh app data after embedded app edit
Invalidate app queries on update so board widgets reflect changes. Sync AppForm with refetched initialValues and reset after submit.
This commit is contained in:
1 parent
b125a6159a
commit
46f19c120d
2 files changed
+29
-8
No files matched your search
@@ -21,11 +21,13 @@ interface EmbeddedAppEditFormProps {
|
||||
|
||||
export const EmbeddedAppEditForm = ({ appId, handleRef }: EmbeddedAppEditFormProps) => {
|
||||
const t = useI18n();
|
||||
const utils = clientApi.useUtils();
|
||||
const appFormRef = useRef<AppFormHandle>(null);
|
||||
const { data: app, isPending: isLoadingApp, isError, refetch } = clientApi.app.byId.useQuery({ id: appId });
|
||||
|
||||
const { mutateAsync, isPending: isMutating } = clientApi.app.update.useMutation({
|
||||
onSuccess: () => {
|
||||
onSuccess: async () => {
|
||||
await utils.app.invalidate();
|
||||
showSuccessNotification({
|
||||
title: t("app.page.edit.notification.success.title"),
|
||||
message: t("app.page.edit.notification.success.message"),
|
||||
|
||||
Reference in new issue
Block a user