Perbaikan PPOB
This commit is contained in:
parent
c95d0c3f46
commit
248f844115
|
@ -275,6 +275,10 @@ export const DetailUser = observer(() => {
|
|||
store.authentication.dataProfit.userDetail?.image_identity,
|
||||
"detail"
|
||||
);
|
||||
console.log(
|
||||
store.authentication.listImage,
|
||||
"detail gambar"
|
||||
);
|
||||
return (
|
||||
<div className={["ppob-container"].join(" ")}>
|
||||
<BreadcumbComponent data={routeData} />
|
||||
|
|
|
@ -255,6 +255,16 @@ export const Membership = observer(() => {
|
|||
];
|
||||
const onSubmit = async (data, image, imageStore) => {
|
||||
data.superior = true;
|
||||
console.log(imageStore, "Apa imageStore")
|
||||
|
||||
if(!imageStore){
|
||||
imageStore = []
|
||||
}
|
||||
|
||||
if (initialData.id) {
|
||||
data.image_identity = image;
|
||||
data.image_store = imageStore;
|
||||
}
|
||||
|
||||
if (initialData.id) {
|
||||
setConfirmLoading(true);
|
||||
|
|
|
@ -38,18 +38,26 @@ export const MembershipModal = ({
|
|||
const [loadingStore, setLoadingStore] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setFileList([{
|
||||
url : `${appConfig.apiUrl}/config/image/${initialData.image_identity}`
|
||||
}])
|
||||
setFileStore([{
|
||||
url : `${appConfig.apiUrl}/config/image/${initialData.image_store}`
|
||||
}])
|
||||
setImage(`${appConfig.apiUrl}/config/image/${initialData.image_identity}`)
|
||||
setImageStore(`${appConfig.apiUrl}/config/image/${initialData.image_store}`)
|
||||
return () => {
|
||||
|
||||
if (initialData.id) {
|
||||
setFileList([
|
||||
{
|
||||
url: `${appConfig.apiUrl}/config/image/${initialData.image_identity}`,
|
||||
},
|
||||
]);
|
||||
setFileStore([
|
||||
{
|
||||
url: `${appConfig.apiUrl}/config/image/${initialData.image_store}`,
|
||||
},
|
||||
]);
|
||||
setImage(
|
||||
`${appConfig.apiUrl}/config/image/${initialData.image_identity}`
|
||||
);
|
||||
setImageStore(
|
||||
`${appConfig.apiUrl}/config/image/${initialData.image_store}`
|
||||
);
|
||||
}
|
||||
}, [initialData])
|
||||
return () => {};
|
||||
}, [initialData]);
|
||||
|
||||
const beforeUpload = (file) => {
|
||||
let isLt2M;
|
||||
|
@ -102,12 +110,15 @@ export const MembershipModal = ({
|
|||
console.log(res, "ini respon 2");
|
||||
setImageStore(`${appConfig.apiUrl}/config/image/${res.body.filename}`);
|
||||
setResponseFilenameStore([...responseFilenameStore, res.body.filename]);
|
||||
setFileStore([...fileStore, {
|
||||
uid: "-1",
|
||||
name: res.body.filename,
|
||||
status: "done",
|
||||
url: `${appConfig.apiUrl}/config/image/${res.body.filename}`,
|
||||
} ]);
|
||||
setFileStore([
|
||||
...fileStore,
|
||||
{
|
||||
uid: "-1",
|
||||
name: res.body.filename,
|
||||
status: "done",
|
||||
url: `${appConfig.apiUrl}/config/image/${res.body.filename}`,
|
||||
},
|
||||
]);
|
||||
|
||||
setLoadingStore(false);
|
||||
};
|
||||
|
@ -170,11 +181,12 @@ export const MembershipModal = ({
|
|||
form
|
||||
.validateFields()
|
||||
.then((values) => {
|
||||
values.image_identity = responseFilename
|
||||
values.image_store = responseFilenameStore
|
||||
onCreate(values,responseFilename,responseFilenameStore);
|
||||
console.log(values, "apa valuesanya");
|
||||
values.image_identity = responseFilename;
|
||||
values.image_store = responseFilenameStore;
|
||||
onCreate(values, responseFilename, responseFilenameStore);
|
||||
form.resetFields();
|
||||
setFileStore([])
|
||||
setFileStore([]);
|
||||
setImage("");
|
||||
setFileList([]);
|
||||
setPreviewImage("");
|
||||
|
@ -467,7 +479,7 @@ export const MembershipModal = ({
|
|||
setFileStore([]);
|
||||
}}
|
||||
>
|
||||
{fileStore.length >= 3 ? null:uploadButtonStore }
|
||||
{fileStore.length >= 3 ? null : uploadButtonStore}
|
||||
</Upload>
|
||||
<h5
|
||||
style={{
|
||||
|
|
|
@ -60,6 +60,7 @@ export class Authentication {
|
|||
console.log(response)
|
||||
this.dataProfit = response.body ?? [];
|
||||
this.listImage = this.dataProfit.userDetail?.image_store ? JSON.parse(this.dataProfit.userDetail?.image_store) : [];
|
||||
|
||||
this.total_data = response?.body?.count ?? 0;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
@ -72,6 +73,8 @@ export class Authentication {
|
|||
console.log(response)
|
||||
this.profileData = response.body;
|
||||
this.imageProfil = this.profileData.userDetail?.image_store ? JSON.parse(this.profileData.userDetail?.image_store) : [];
|
||||
|
||||
//this.imageProfil = this.profileData.userDetail?.image_store ? JSON.parse(this.profileData.userDetail?.image_store) : [];
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user