Skip to content

Commit

Permalink
Merge branch 'sanjeewa' into sanjeewa_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
nmdra committed Oct 7, 2024
2 parents 64bc423 + ee6521a commit 3a802c7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
1 change: 0 additions & 1 deletion frontend/src/Pages/delivery/DLDriverAccept.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ const DLDriverAccept = () => {
return <div className="text-center mt-10">Loading...</div>

// Construct the full URL for each image
// const baseUrl = 'http://localhost:3000/'
const idCardImageUrl = `${driverDetails.idCardImageUrl}`
const licenseImageUrl = `${driverDetails.licenseImageUrl}`
const personalImageUrl = `${driverDetails.personalImageUrl}`
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/delivery/DLImageUpload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const DLImageUpload = () => {

try {
const response = await axios.post(
'http://localhost:3000/api/delivery/images/upload',
'/api/delivery/images/upload',
formData,
{
headers: {
Expand Down
1 change: 0 additions & 1 deletion frontend/src/Pages/delivery/DLViewDriver.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const DLViewDriver = () => {
}

// Construct the full URL for each image
//const baseUrl = 'http://localhost:3000/'
const idCardImageUrl = `${driverDetails.idCardImageUrl}`
const licenseImageUrl = `${driverDetails.licenseImageUrl}`
const personalImageUrl = `${driverDetails.personalImageUrl}`
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/Pages/delivery/DLeditdriver.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ const DLViewDriver = () => {
}

// Construct the full URL for each image
const baseUrl = 'http://localhost:3000/'
const idCardImageUrl = `${baseUrl}${driverDetails.idCardImageUrl}`
const licenseImageUrl = `${baseUrl}${driverDetails.licenseImageUrl}`
const personalImageUrl = `${baseUrl}${driverDetails.personalImageUrl}`
//const baseUrl = 'http://localhost:3000/'
const idCardImageUrl = `${driverDetails.idCardImageUrl}`
const licenseImageUrl = `${driverDetails.licenseImageUrl}`
const personalImageUrl = `${driverDetails.personalImageUrl}`

// Handler to open image in a modal
const handleImageClick = (imageUrl) => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/Pages/delivery/DLoooo.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react'

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

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

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

[no-unused-vars] 'React' is defined but never used.
import axios from '../../axios'
import axios from 'axios'

const CreateOrderForm = () => {
const [orderID, setOrderID] = useState('')
Expand Down Expand Up @@ -36,7 +36,7 @@ const CreateOrderForm = () => {

try {
const response = await axios.post(
'http://localhost:3000/api/od/a',
'/api/od/a',
newOrder
)
console.log('Order created:', response.data)
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/Pages/delivery/or/orderdelete.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const OrdersTable = () => {
const fetchOrders = async () => {
try {
const response = await axios.get(
'http://localhost:3000/api/od/g'
'/api/od/g'
) // Ensure this route is correct
setOrders(response.data)
} catch (error) {
Expand All @@ -25,7 +25,7 @@ const OrdersTable = () => {
if (window.confirm('Are you sure you want to delete this order?')) {
try {
// Send DELETE request to the backend
await axios.delete(`http://localhost:3000/api/od/d/${id}`)
await axios.delete(`/api/od/d/${id}`)

// Remove the order from the UI after successful deletion
setOrders(orders.filter((order) => order._id !== id))
Expand Down

0 comments on commit 3a802c7

Please sign in to comment.