diff --git a/src/Pages/Partners/EditPartners.jsx b/src/Pages/Partners/EditPartners.jsx
index b5a2b09..1952613 100644
--- a/src/Pages/Partners/EditPartners.jsx
+++ b/src/Pages/Partners/EditPartners.jsx
@@ -39,15 +39,13 @@ const EditPartner = () => {
const { id } = useParams();
const toast = useToast();
const navigate = useNavigate();
- const { data, error, isLoading } = useGetPartnersByIdQuery(id);
+ const { data, error, isLoading, refetch } = useGetPartnersByIdQuery(id);
const [isLoadingEdit, setIsLoadingEdit] = useState(false);
const [selectedImage, setSelectedImage] = useState(fallbackImage);
const [largeImageData, setLargeImageData] = useState(null);
const [updatePartners] = useUpdatePartnersMutation();
const [valueQuill, setValueQuill] = useState(data?.data?.content);
- console.log(valueQuill);
-
const {
register,
handleSubmit,
@@ -59,7 +57,7 @@ const EditPartner = () => {
defaultValues: {
website_link: "",
description: "",
- company_logo: null,
+ banner_image: "",
},
});
@@ -73,7 +71,7 @@ const EditPartner = () => {
);
setValue("website_link", data?.data?.website_link);
setValue("description", data?.data?.description);
- setValue("company_logo", data?.data?.company_logo);
+ setValue("banner_image", data?.data?.banner_image);
// setValueQuill(data?.data?.content);
}
}, [data, setValue]);
@@ -97,8 +95,8 @@ const EditPartner = () => {
const form = new FormData();
form.append("website_link", data?.website_link);
form.append("description", data?.description);
- if (data?.company_logo[0]) {
- form.append("company_logo", data?.company_logo[0]);
+ if (data?.banner_image[0]) {
+ form.append("banner_image", data?.banner_image[0]);
}
// Log formData entries
@@ -116,7 +114,7 @@ const EditPartner = () => {
),
});
-
+ refetch();
reset();
navigate("/partners");
// setDeleteAlert(false);
@@ -298,7 +296,7 @@ const EditPartner = () => {
{
flexDirection={"column"}
>
diff --git a/src/Pages/Usecase/EditUseCase.jsx b/src/Pages/Usecase/EditUseCase.jsx
index 3128750..38c092c 100644
--- a/src/Pages/Usecase/EditUseCase.jsx
+++ b/src/Pages/Usecase/EditUseCase.jsx
@@ -16,15 +16,13 @@ import {
Kbd,
} from "@chakra-ui/react";
import {
- useGetBlogByIdQuery,
useGetUsecaseByIdQuery,
- useUpdateBlogMutation,
useUpdateUsecaseMutation,
} from "../../Services/api.service";
import { useForm } from "react-hook-form";
import { yupResolver } from "@hookform/resolvers/yup";
import FullscreenLoaders from "../../Components/Loaders/FullscreenLoaders";
-import { addBlogSchema, addUsecase, editUsecase } from "../../Validations/Validations";
+import { editUsecase } from "../../Validations/Validations";
import fallbackImage from "../../assets/fallBackImage.png";
import fallbackImageLarge from "../../assets/ultp-fallback-img.webp";
import { OPACITY_ON_LOAD } from "../../Layout/animations";
@@ -70,9 +68,9 @@ const EditUseCase = () => {
title: blog?.title,
meta_description: blog?.meta_description,
content: blog?.content,
- // banner_image: null,
- // icon: null,
- // attachment: null,
+ // banner_image: null,
+ // icon: null,
+ // attachment: null,
},
});
@@ -103,11 +101,11 @@ const EditUseCase = () => {
if (data?.icon[0]) {
formData.append("icon", data.icon[0]);
}
- if(data?.attachment !== blog?.attachment){
- Array.from(data?.attachment).forEach((file, index) => {
+ if (data?.attachment !== blog?.attachment) {
+ Array.from(data?.attachment).forEach((file, index) => {
formData.append(`attachment`, file);
- })}
-
+ });
+ }
try {
setIsLoading01(true);
@@ -130,7 +128,7 @@ const EditUseCase = () => {
});
reset();
navigate("/usecase");
- }else if(response?.error?.status === 500){
+ } else if (response?.error?.status === 500) {
setIsLoading01(false);
toast({
render: () => (
@@ -140,7 +138,6 @@ const EditUseCase = () => {
/>
),
});
-
}
})
.catch((error) => {
@@ -193,7 +190,7 @@ const EditUseCase = () => {
display={"flex"}
flexDirection={"column"}
>
-
+
@@ -339,7 +336,7 @@ const EditUseCase = () => {
)}
-
+
Banner image
@@ -549,12 +546,18 @@ const EditUseCase = () => {
className="web-text-medium form-control rounded-1"
size="sm"
multiple={true}
- onChange={()=> console.log(e.target.value)}
- />
- You can select multiple documents using
-ctrl + select
-.
-
+ onChange={() => console.log(e.target.value)}
+ />
+
+ You can select multiple documents using{" "}
+
+
+ ctrl
+ {" "}
+ + select
+
+ .
+
{errors.attachment && (
{" "}
diff --git a/src/Validations/Validations.js b/src/Validations/Validations.js
index 02ab05a..3f3b517 100644
--- a/src/Validations/Validations.js
+++ b/src/Validations/Validations.js
@@ -578,7 +578,7 @@ export const addPolicy = Yup.object().shape({
export const addPartnerCard = Yup.object().shape({
website_link: Yup.string().required("link is required"),
description: Yup.string().required("description is required"),
- company_logo: Yup.mixed().required("logo is required")
+ banner_image: Yup.mixed().required("logo is required")
// .test("required", "You need to provide a file", (files) => {
// // return file && file.size <-- u can use this if you don't want to allow empty files to be uploaded;
// if (files) return true;