Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing the final one #23

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions backend/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,13 @@ import {
startSyncDeliveryOrderStatus,
} from './controllers/DLOcontroller.js' // Import the periodic check

<<<<<<< HEAD
=======


//Help Routes
import routes from './routes/Help/index.js'


<<<<<<< Updated upstream
=======
>>>>>>> f32c50044c74728373eafb28103c74438c160c64
>>>>>>> Stashed changes

// Production-only delivery task scheduling
if (process.env.SERVER_ENV === 'production') {
checkForAvailableDrivers()
Expand All @@ -52,22 +48,14 @@ if (process.env.SERVER_ENV === 'production') {
cleanUpDuplicateDeliveries()
}

<<<<<<< Updated upstream
=======
<<<<<<< HEAD
=======
>>>>>>> Stashed changes
// Blog, Comments, and News Imports (Merged Content)
import blogRouter from './routes/Blog.js'
import commentRoutes from './routes/comments.js'
import newsRoutes from './routes/newsRoutes.js'


// Error handling
<<<<<<< Updated upstream
=======
>>>>>>> f32c50044c74728373eafb28103c74438c160c64
>>>>>>> Stashed changes

import { errorHandler, notFound } from './middlewares/errorMiddleware.js'

// Set up port from environment or default to 8000
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Components/Admin/admnlogins.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useState } from 'react'

Check failure on line 1 in frontend/src/Components/Admin/admnlogins.jsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

frontend/src/Components/Admin/admnlogins.jsx#L1

[no-unused-vars] 'React' is defined but never used.
import { useNavigate } from 'react-router-dom'
import { ToastContainer, toast } from 'react-toastify'
import 'react-toastify/dist/ReactToastify.css'
import farmcartLogo from '../../assets/logo.png' // Update with correct path if needed

const AdminLogin = ({ manager }) => {

Check failure on line 7 in frontend/src/Components/Admin/admnlogins.jsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

frontend/src/Components/Admin/admnlogins.jsx#L7

[react/prop-types] 'manager' is missing in props validation
// Receive the manager prop
const navigate = useNavigate()
const [email, setEmail] = useState('')
Expand Down Expand Up @@ -62,7 +62,7 @@
<img
src={farmcartLogo} // Replace with the path to your logo image
alt="Logo"
className="h-16 w-auto mb-4 mx-auto"
className="h-10 w-auto mb-4 mx-auto"
/>
<div className="text-left mb-5">
<h2 className="text-3xl font-bold">Admin Login</h2>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/Layouts/BlogLayout.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Outlet } from 'react-router-dom'
// import Footer from '../Components/Home/Footer'
import Footer from '../Components/Home/FooterDashboard'
import DHeader from '../Components/Home/DHeader'
import BlogHeader from '../Components/Home/BlogHeader'

function BlogLayout() {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/delivery/DLDriverRegistrationForm.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react'

Check failure on line 1 in frontend/src/Pages/delivery/DLDriverRegistrationForm.jsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

frontend/src/Pages/delivery/DLDriverRegistrationForm.jsx#L1

[no-unused-vars] 'React' is defined but never used.
import axios from '../../axios' // Import your axios instance with baseURL and interceptor
import { useNavigate } from 'react-router-dom'
import Swal from 'sweetalert2' // For user-friendly alerts
Expand Down Expand Up @@ -36,7 +36,7 @@
license: false,
personal: false,
})
const [successMessage, setSuccessMessage] = useState('')

Check failure on line 39 in frontend/src/Pages/delivery/DLDriverRegistrationForm.jsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

frontend/src/Pages/delivery/DLDriverRegistrationForm.jsx#L39

[no-unused-vars] 'setSuccessMessage' is assigned a value but never used.
const navigate = useNavigate()

// Function to calculate age from birth date
Expand Down Expand Up @@ -133,7 +133,7 @@
// Ensure the NIC is not longer than 12 characters
if (value.length > 12) {
return
errorMessage = 'NIC cannot exceed 12 characters.'

Check failure on line 136 in frontend/src/Pages/delivery/DLDriverRegistrationForm.jsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

frontend/src/Pages/delivery/DLDriverRegistrationForm.jsx#L136

[no-unreachable] Unreachable code.
} else if (!nicRegex.test(value)) {
errorMessage = 'Please enter a valid NIC.'
} else if (!value.startsWith(birthYear)) {
Expand Down Expand Up @@ -292,7 +292,7 @@
<img
src={farmcartLogo} // Replace with the path to your logo image
alt="Logo"
className="h-16 w-auto mb-4 mx-auto" // Adjust the height as needed
className="h-10 w-auto mb-4 mx-auto" // Adjust the height as needed
/>
<h2 className="text-3xl font-bold mb-6 text-center">
Driver Registration Form
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/delivery/DLLogin.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react'

Check failure on line 1 in frontend/src/Pages/delivery/DLLogin.jsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

frontend/src/Pages/delivery/DLLogin.jsx#L1

[no-unused-vars] 'React' is defined but never used.
import { useNavigate, Link } from 'react-router-dom'
import axios from 'axios'
import { ToastContainer, toast } from 'react-toastify'
Expand Down Expand Up @@ -32,7 +32,7 @@
<img
src={farmcartLogo} // Replace with the path to your logo image
alt="Logo"
className="h-16 w-auto mb-4 mx-auto" // Adjust the height as needed
className="h-10 w-auto mb-4 mx-auto" // Adjust the height as needed
/>
<div className="text-left mb-5">
<h2 className="text-3xl font-bold">Driver Login</h2>
Expand Down Expand Up @@ -87,7 +87,7 @@
</Link>
</div>
<div className="mt-4">
<span>If you don't have an account?</span>{' '}

Check failure on line 90 in frontend/src/Pages/delivery/DLLogin.jsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

frontend/src/Pages/delivery/DLLogin.jsx#L90

[react/no-unescaped-entities] `'` can be escaped with `&apos;`, `&lsquo;`, `&#39;`, `&rsquo;`.
<Link
to="/register-driver"
className="text-blue-600 hover:underline"
Expand Down
Loading