shop 업데이트
This commit is contained in:
parent
3d6afdd61d
commit
ff2c1ee2ee
@ -17,7 +17,7 @@ const TABLE_HEAD = [
|
||||
{ id: 'name', label: 'Shop', alignRight: false, sort: true },
|
||||
{ id: 'owner', label: 'Owner', alignRight: false, sort: true },
|
||||
{ id: 'products', label: 'products', alignRight: false, sort: true },
|
||||
{ id: 'status', label: 'Status', alignRight: false, sort: false },
|
||||
// { id: 'status', label: 'Status', alignRight: false, sort: false },
|
||||
{ id: '', label: 'Actions', alignRight: true }
|
||||
];
|
||||
|
||||
@ -36,7 +36,7 @@ export default function AdminProducts() {
|
||||
onError: (err) => toast.error(err.response.data.message || 'Something went wrong!')
|
||||
}
|
||||
);
|
||||
console.log(data, 'data123');
|
||||
console.log(data);
|
||||
const handleClickOpen = (prop) => () => {
|
||||
setId(prop);
|
||||
setOpen(true);
|
||||
|
@ -82,32 +82,32 @@ export default function AdminShopForm({ data: currentShop, isLoading: shopLoadin
|
||||
});
|
||||
const ShopSettingScema = Yup.object().shape({
|
||||
title: Yup.string().required('title is required'),
|
||||
cover: Yup.mixed().required('Cover is required'),
|
||||
logo: Yup.mixed().required('logo is required'),
|
||||
slug: Yup.string().required('Slug is required'),
|
||||
message: Yup.string().min(10, 'Message must be at least 10 words').max(50, 'Message must be at most 50 words'),
|
||||
description: Yup.string().required('Description is required'),
|
||||
metaTitle: Yup.string().required('Meta title is required'),
|
||||
metaDescription: Yup.string().required('Meta description is required'),
|
||||
// cover: Yup.mixed().required('Cover is required'),
|
||||
// logo: Yup.mixed().required('logo is required'),
|
||||
// slug: Yup.string().required('Slug is required'),
|
||||
// message: Yup.string().min(10, 'Message must be at least 10 words').max(50, 'Message must be at most 50 words'),
|
||||
// description: Yup.string().required('Description is required'),
|
||||
// metaTitle: Yup.string().required('Meta title is required'),
|
||||
// metaDescription: Yup.string().required('Meta description is required'),
|
||||
phone: Yup.string().required('Phone Number is required'),
|
||||
paymentInfo: Yup.object().shape({
|
||||
holderName: Yup.string().required('Holder Name is required'),
|
||||
holderEmail: Yup.string().required('Holder email is required'),
|
||||
bankName: Yup.string().required('Bank name is required'),
|
||||
AccountNo: Yup.number().required('Account No is required')
|
||||
// holderName: Yup.string().required('Holder Name is required')
|
||||
// holderEmail: Yup.string().required('Holder email is required'),
|
||||
// bankName: Yup.string().required('Bank name is required'),
|
||||
// AccountNo: Yup.number().required('Account No is required')
|
||||
}),
|
||||
address: Yup.object().shape({
|
||||
country: Yup.string().required('Country is required'),
|
||||
city: Yup.string().required('City is required'),
|
||||
state: Yup.string().required('State is required'),
|
||||
// country: Yup.string().required('Country is required'),
|
||||
// city: Yup.string().required('City is required'),
|
||||
// state: Yup.string().required('State is required'),
|
||||
streetAddress: Yup.string().required('Street Address is required')
|
||||
})
|
||||
});
|
||||
const formik = useFormik({
|
||||
initialValues: {
|
||||
title: currentShop?.title || '',
|
||||
metaTitle: currentShop?.metaTitle || '',
|
||||
cover: currentShop?.cover || null,
|
||||
// metaTitle: currentShop?.metaTitle || '',
|
||||
// cover: currentShop?.cover || null,
|
||||
logo: currentShop?.logo || null,
|
||||
description: currentShop?.description || '',
|
||||
metaDescription: currentShop?.metaDescription || '',
|
||||
@ -228,10 +228,7 @@ export default function AdminShopForm({ data: currentShop, isLoading: shopLoadin
|
||||
};
|
||||
const handleTitleChange = (event) => {
|
||||
const title = event.target.value;
|
||||
const slug = title
|
||||
.toLowerCase()
|
||||
.replace(/[^a-zA-Z0-9\s]+/g, '')
|
||||
.replace(/\s+/g, '-'); // convert to lowercase, remove special characters, and replace spaces with hyphens
|
||||
const slug = title.toLowerCase().replace(/\s+/g, '-'); // convert to lowercase, remove special characters, and replace spaces with hyphens
|
||||
formik.setFieldValue('slug', slug); // set the value of slug in the formik state
|
||||
formik.handleChange(event); // handle the change in formik
|
||||
};
|
||||
|
@ -86,7 +86,7 @@ export default function RegisterForm() {
|
||||
<Stack direction={{ xs: 'column', sm: 'row' }} spacing={2}>
|
||||
<Stack gap={0.5} width={1}>
|
||||
<Typography variant="overline" color="text.primary" htmlFor="firstName" component={'label'}>
|
||||
First Name
|
||||
{lang['First Name']}
|
||||
</Typography>
|
||||
<TextField
|
||||
id="firstName"
|
||||
|
@ -96,7 +96,7 @@ export default function ProductRow({ isLoading, row, handleClickOpen }) {
|
||||
</TableCell>
|
||||
<TableCell>{isLoading ? <Skeleton variant="text" /> : <>{row.products.length || 0}</>}</TableCell>
|
||||
|
||||
<TableCell>
|
||||
{/* <TableCell>
|
||||
{isLoading ? (
|
||||
<Skeleton variant="text" />
|
||||
) : (
|
||||
@ -125,7 +125,7 @@ export default function ProductRow({ isLoading, row, handleClickOpen }) {
|
||||
{row?.status}
|
||||
</Label>
|
||||
)}
|
||||
</TableCell>
|
||||
</TableCell> */}
|
||||
<TableCell align="right">
|
||||
{isLoading ? (
|
||||
<Stack direction="row" justifyContent="flex-end">
|
||||
|
Loading…
Reference in New Issue
Block a user