mirror of
https://github.com/formbricks/formbricks.git
synced 2026-03-20 17:31:27 -05:00
fix edit product name not showing in navbar
This commit is contained in:
@@ -9,10 +9,12 @@ import { useProductMutation } from "@/lib/products/mutateProducts";
|
||||
import { useProduct } from "@/lib/products/products";
|
||||
import { useForm } from "react-hook-form";
|
||||
import toast from "react-hot-toast";
|
||||
import { useEnvironment } from "@/lib/environments/environments";
|
||||
|
||||
export function EditProductName({ environmentId }) {
|
||||
const { product, isLoadingProduct, isErrorProduct } = useProduct(environmentId);
|
||||
const { isMutatingProduct, triggerProductMutate } = useProductMutation(environmentId);
|
||||
const { mutateEnvironment } = useEnvironment(environmentId);
|
||||
|
||||
const { register, handleSubmit } = useForm();
|
||||
|
||||
@@ -30,6 +32,7 @@ export function EditProductName({ environmentId }) {
|
||||
triggerProductMutate(data)
|
||||
.then(() => {
|
||||
toast.success("Product name updated successfully.");
|
||||
mutateEnvironment();
|
||||
})
|
||||
.catch((error) => {
|
||||
toast.error(`Error: ${error.message}`);
|
||||
|
||||
@@ -12,6 +12,6 @@ export const useEnvironment = (environmentId: string) => {
|
||||
isLoadingEnvironment: isLoading,
|
||||
isErrorEnvironment: error,
|
||||
isValidatingEnvironment: isValidating,
|
||||
mutateOrganisation: mutate,
|
||||
mutateEnvironment: mutate,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user