first commit
This commit is contained in:
parent
ba5f9d1826
commit
7ed4d69138
@ -15,7 +15,7 @@
|
|||||||
<meta name="description" content="CoreUI for React - Open Source Bootstrap Admin Template">
|
<meta name="description" content="CoreUI for React - Open Source Bootstrap Admin Template">
|
||||||
<meta name="author" content="Łukasz Holeczek">
|
<meta name="author" content="Łukasz Holeczek">
|
||||||
<meta name="keyword" content="Bootstrap,Admin,Template,Open,Source,CSS,SCSS,HTML,RWD,Dashboard,React">
|
<meta name="keyword" content="Bootstrap,Admin,Template,Open,Source,CSS,SCSS,HTML,RWD,Dashboard,React">
|
||||||
<title>ATP-Dashboard</title>
|
<title>Airport Admin</title>
|
||||||
<!--
|
<!--
|
||||||
manifest.json provides metadata used when your web app is added to the
|
manifest.json provides metadata used when your web app is added to the
|
||||||
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
||||||
|
@ -11,8 +11,8 @@ import axios from 'axios'
|
|||||||
import { store } from './redux/store';
|
import { store } from './redux/store';
|
||||||
|
|
||||||
const setupAxios = () => {
|
const setupAxios = () => {
|
||||||
axios.defaults.baseURL = 'https://atpapi.checkapp.one'
|
// axios.defaults.baseURL = 'https://atpapi.checkapp.one'
|
||||||
//axios.defaults.baseURL = 'http://localhost:5000'
|
axios.defaults.baseURL = 'http://localhost:5000'
|
||||||
axios.defaults.headers = {
|
axios.defaults.headers = {
|
||||||
'Cache-Control': 'no-cache,no-store',
|
'Cache-Control': 'no-cache,no-store',
|
||||||
'Pragma': 'no-cache',
|
'Pragma': 'no-cache',
|
||||||
|
@ -183,8 +183,8 @@ const AddFranchisee = () => {
|
|||||||
data.city === '' ||
|
data.city === '' ||
|
||||||
data.pin_Code.trim() === '' ||
|
data.pin_Code.trim() === '' ||
|
||||||
data.short_url === '' ||
|
data.short_url === '' ||
|
||||||
data.state_name === '' ||
|
data.state_name === ''
|
||||||
data.imageURL.trim() === ''
|
// data.imageURL.trim() === ''
|
||||||
) {
|
) {
|
||||||
swal({
|
swal({
|
||||||
title: 'Warning',
|
title: 'Warning',
|
||||||
@ -483,7 +483,7 @@ const AddFranchisee = () => {
|
|||||||
|
|
||||||
<div className="mb-3">
|
<div className="mb-3">
|
||||||
<label htmlFor="image" className="form-label">
|
<label htmlFor="image" className="form-label">
|
||||||
Temple Banner*
|
Franchisee Banner (optional)
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
|
@ -115,54 +115,6 @@ const EditFranchisee = () => {
|
|||||||
}
|
}
|
||||||
}, [errors])
|
}, [errors])
|
||||||
|
|
||||||
// const handleChange = (e) => {
|
|
||||||
// if (e.target.id === 'name') {
|
|
||||||
// if (e.target.value.length === limiter[e.target.id] + 1) return
|
|
||||||
// setLimiter((prev) => ({
|
|
||||||
// ...prev,
|
|
||||||
// [e.target.id + 'Has']: prev[e.target.id] - e.target.value.length,
|
|
||||||
// }))
|
|
||||||
// if (e.target.id === 'email') {
|
|
||||||
// setErrors({
|
|
||||||
// ...errors,
|
|
||||||
// emailError: validEmailRegex.test(e.target.value) ? '' : 'Email is not valid!',
|
|
||||||
// })
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
// // setData((prev) => ({ ...prev, short_url: e.target.value.toLowerCase().replace(/\s+/g, '-') }))
|
|
||||||
// }
|
|
||||||
// if (e.target.id === 'image') {
|
|
||||||
// if (
|
|
||||||
// e.target.files[0]?.type === 'image/jpeg' ||
|
|
||||||
// e.target.files[0]?.type === 'image/png' ||
|
|
||||||
// e.target.files[0]?.type === 'image/jpg'
|
|
||||||
// ) {
|
|
||||||
// setData((prev) => ({
|
|
||||||
// ...prev,
|
|
||||||
// imageURL: URL.createObjectURL(e.target.files[0]),
|
|
||||||
// image: e.target.files[0],
|
|
||||||
// }))
|
|
||||||
// return
|
|
||||||
// } else {
|
|
||||||
// swal({
|
|
||||||
// title: 'Warning',
|
|
||||||
// text: 'Upload jpg, jpeg, png only.',
|
|
||||||
// icon: 'error',
|
|
||||||
// button: 'Close',
|
|
||||||
// dangerMode: true,
|
|
||||||
// })
|
|
||||||
// setData((prev) => ({
|
|
||||||
// ...prev,
|
|
||||||
// imageURL: '',
|
|
||||||
// image: '',
|
|
||||||
// }))
|
|
||||||
// e.target.value = null
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// setData((prev) => ({ ...prev, [e.target.id]: e.target.value }))
|
|
||||||
// }
|
|
||||||
|
|
||||||
const handleChange = (e) => {
|
const handleChange = (e) => {
|
||||||
if (e.target.id === 'name') {
|
if (e.target.id === 'name') {
|
||||||
@ -230,8 +182,8 @@ const EditFranchisee = () => {
|
|||||||
data.city === '' ||
|
data.city === '' ||
|
||||||
data.pin_Code === '' ||
|
data.pin_Code === '' ||
|
||||||
data.short_url === '' ||
|
data.short_url === '' ||
|
||||||
data.state_name === '' ||
|
data.state_name === ''
|
||||||
data.imageURL.trim() === ''
|
// data.imageURL.trim() === ''
|
||||||
) {
|
) {
|
||||||
swal({
|
swal({
|
||||||
title: 'Warning',
|
title: 'Warning',
|
||||||
@ -553,7 +505,7 @@ const EditFranchisee = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="mb-3">
|
<div className="mb-3">
|
||||||
<label htmlFor="image" className="form-label">
|
<label htmlFor="image" className="form-label">
|
||||||
franchisee Banner*
|
Franchisee Banner (optional)
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
|
@ -29,6 +29,7 @@ const Franchisees = () => {
|
|||||||
headers: { 'Access-Control-Allow-Origin': '*', Authorization: `Bearer ${token}` },
|
headers: { 'Access-Control-Allow-Origin': '*', Authorization: `Bearer ${token}` },
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
// console.log(res.data.data)
|
||||||
setFranchiseesData(res.data.data)
|
setFranchiseesData(res.data.data)
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
})
|
})
|
||||||
@ -51,6 +52,43 @@ const Franchisees = () => {
|
|||||||
loadData()
|
loadData()
|
||||||
}, [currentPage, itemPerPage, FranchiseesData])
|
}, [currentPage, itemPerPage, FranchiseesData])
|
||||||
|
|
||||||
|
|
||||||
|
const handleVarification = (id) => {
|
||||||
|
swal({
|
||||||
|
title: 'Are you sure?',
|
||||||
|
icon: 'warning',
|
||||||
|
buttons: { Yes: { text: 'Yes', value: true }, Cancel: { text: 'Cancel', value: 'cancel' } },
|
||||||
|
}).then((value) => {
|
||||||
|
if (value === true) {
|
||||||
|
axios
|
||||||
|
.get(`/api/franchisee/admin/verify/${id}`, {
|
||||||
|
headers: {
|
||||||
|
'Access-Control-Allow-Origin': '*',
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
swal({
|
||||||
|
title: 'success',
|
||||||
|
text: res.data.message ? res.data.message : 'Verified Successfully!',
|
||||||
|
icon: 'success',
|
||||||
|
button: 'ok',
|
||||||
|
dangerMode: true,
|
||||||
|
})
|
||||||
|
setSuccess((prev) => !prev)
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
swal({
|
||||||
|
title: 'Failled',
|
||||||
|
text: 'Something went wrong!',
|
||||||
|
icon: 'error',
|
||||||
|
button: 'Retry',
|
||||||
|
dangerMode: true,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
const handleDelete = (id) => {
|
const handleDelete = (id) => {
|
||||||
swal({
|
swal({
|
||||||
title: 'Are you sure?',
|
title: 'Are you sure?',
|
||||||
@ -158,6 +196,7 @@ const Franchisees = () => {
|
|||||||
<th className="text-start">Logo</th>
|
<th className="text-start">Logo</th>
|
||||||
<th className="text-start">City </th>
|
<th className="text-start">City </th>
|
||||||
<th className="text-start">Created On</th>
|
<th className="text-start">Created On</th>
|
||||||
|
<th className="text-start">Status</th>
|
||||||
<th className="text-center">Actions</th>
|
<th className="text-center">Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -180,10 +219,14 @@ const Franchisees = () => {
|
|||||||
return (
|
return (
|
||||||
<tr key={i}>
|
<tr key={i}>
|
||||||
<td className="text-start">{franchisee.name}</td>
|
<td className="text-start">{franchisee.name}</td>
|
||||||
<td className="text-start">
|
{franchisee.banner && franchisee.banner ?
|
||||||
<img src={franchisee.banner.url} alt="Test Image" height="50" />
|
<td className="text-start">
|
||||||
</td>
|
<img src={franchisee.banner.url} alt="No Image" height="50" />
|
||||||
|
</td> :
|
||||||
|
<p>No image!</p>
|
||||||
|
}
|
||||||
<td className="text-start">{franchisee?.city?.city_name}</td>
|
<td className="text-start">{franchisee?.city?.city_name}</td>
|
||||||
|
|
||||||
<td className="text-start">
|
<td className="text-start">
|
||||||
{new Date(franchisee.createdAt).toLocaleString('en-IN', {
|
{new Date(franchisee.createdAt).toLocaleString('en-IN', {
|
||||||
month: '2-digit',
|
month: '2-digit',
|
||||||
@ -194,6 +237,25 @@ const Franchisees = () => {
|
|||||||
// hour12: true,
|
// hour12: true,
|
||||||
})}
|
})}
|
||||||
</td>
|
</td>
|
||||||
|
<td className="text-start">
|
||||||
|
<button
|
||||||
|
style={{ color: 'white' }}
|
||||||
|
type="button"
|
||||||
|
className={`
|
||||||
|
|
||||||
|
btn ${franchisee?.verify === true ? 'btn-success' : 'btn-danger'} btn-sm
|
||||||
|
waves-effect waves-light
|
||||||
|
ms-2
|
||||||
|
|
||||||
|
`}
|
||||||
|
disabled={franchisee?.verify === true}
|
||||||
|
onClick={() => {
|
||||||
|
handleVarification(franchisee._id)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{franchisee?.verify ? 'verified' : 'Not Verify'}
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
<td className=" text-center">
|
<td className=" text-center">
|
||||||
<OverLayButton data={{ url: franchisee?.url }} />
|
<OverLayButton data={{ url: franchisee?.url }} />
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ const Login = () => {
|
|||||||
<CCardBody>
|
<CCardBody>
|
||||||
<CForm>
|
<CForm>
|
||||||
<h1>Login</h1>
|
<h1>Login</h1>
|
||||||
<p className="text-medium-emphasis">Sign In to Your ATP Dashboard Account.</p>
|
<p className="text-medium-emphasis">Sign In to Your ChatGpt Airport Admin Dashboard Account.</p>
|
||||||
<CInputGroup className="mb-3">
|
<CInputGroup className="mb-3">
|
||||||
<CInputGroupText>
|
<CInputGroupText>
|
||||||
<CIcon icon={cilUser} />
|
<CIcon icon={cilUser} />
|
||||||
|
Loading…
Reference in New Issue
Block a user