Skip to content

Commit

Permalink
resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
shivamm31 committed Feb 21, 2024
1 parent a39ee0e commit 646c47d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 21 deletions.
58 changes: 40 additions & 18 deletions car-ui-react/data/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"best_seller": false,
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://i.pinimg.com/736x/fa/be/08/fabe082d7ca96325961ddd6019583cb7--mystique-ford-contour.jpg",
"in_stock": true
"in_stock": true,
"id": "f566"
},
{
"carId": 4548,
Expand All @@ -30,7 +31,8 @@
"best_seller": true,
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://www.cartoq.com/wp-content/uploads/2021/09/XUV700-Dark-Knight-edition-featured.jpg",
"in_stock": false
"in_stock": false,
"id": "b2bc"
},
{
"carId": 1556,
Expand All @@ -47,7 +49,7 @@
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://static.autox.com/uploads/2022/06/Mahindra-Scorpio-N-exterior.png",
"in_stock": true,
"id": "9320"
"id": "1da2"
},
{
"carId": 4752,
Expand All @@ -63,7 +65,8 @@
"best_seller": false,
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://paultan.org/image/2020/10/2021-Hyundai-i20-N-Exterior-7.jpg",
"in_stock": true
"in_stock": true,
"id": "5d64"
},
{
"carId": 4654,
Expand All @@ -79,7 +82,8 @@
"best_seller": true,
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://th.bing.com/th/id/OIP.5i-hWiOn_6RnqXoDoA-H2QHaEo?rs=1&pid=ImgDetMain",
"in_stock": false
"in_stock": false,
"id": "349d"
},
{
"carId": 1458,
Expand All @@ -95,7 +99,8 @@
"best_seller": false,
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://english.cdn.zeenews.com/sites/default/files/2022/10/31/1110417-tata-safari-classic-front.jpg",
"in_stock": true
"in_stock": true,
"id": "a64d"
},
{
"carId": 5467,
Expand All @@ -111,7 +116,8 @@
"best_seller": false,
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://th.bing.com/th/id/OIP.qzSsXvyXs_A9WpKfF97yJQHaFJ?rs=1&pid=ImgDetMain",
"in_stock": true
"in_stock": true,
"id": "ad0a"
},
{
"carId": 4567,
Expand All @@ -127,7 +133,8 @@
"best_seller": false,
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://th.bing.com/th/id/OIP.EL6O-LdJztIEA7BuFBQWtwHaEK?rs=1&pid=ImgDetMain",
"in_stock": true
"in_stock": true,
"id": "ed24"
},
{
"carId": 6424,
Expand All @@ -143,7 +150,8 @@
"best_seller": false,
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://imgd.aeplcdn.com/642x336/n/cw/ec/121943/verna-facelift-exterior-right-front-three-quarter.jpeg?isig=0&q=75",
"in_stock": false
"in_stock": false,
"id": "690b"
},
{
"carId": 1648,
Expand All @@ -159,7 +167,8 @@
"best_seller": false,
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://images.news18.com/ibnlive/uploads/2021/06/1623556020_2021-hyundai-aura.png",
"in_stock": true
"in_stock": true,
"id": "3c64"
},
{
"carId": 1879,
Expand All @@ -175,7 +184,8 @@
"best_seller": true,
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://img-ik.cars.co.za/news-site-za/images/2014/06/Grand-i10-5_1800x1800.jpg?tr=w-1200,h-800",
"in_stock": true
"in_stock": true,
"id": "bc82"
},
{
"carId": 1349,
Expand All @@ -191,7 +201,8 @@
"best_seller": true,
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://ic1.maxabout.us/autos/cars_india/N/2020/10/new-tata-nexon-front-3-quarter-view.jpg",
"in_stock": true
"in_stock": true,
"id": "4700"
},
{
"carId": 1485,
Expand All @@ -207,7 +218,8 @@
"best_seller": false,
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://4.bp.blogspot.com/-oOSRY7taTeo/WeYL7s7_8oI/AAAAAAAADKk/W27Zu3lA_LkTaJoOILKePTTG0WStERKkgCLcBGAs/s1600/Honda%2Bcivic%2B2017%2Bfault.jpg",
"in_stock": true
"in_stock": true,
"id": "3c24"
}
],
"featured_products": [
Expand All @@ -225,7 +237,8 @@
"best_seller": true,
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://ic1.maxabout.us/autos/cars_india/N/2020/10/new-tata-nexon-front-3-quarter-view.jpg",
"in_stock": true
"in_stock": true,
"id": "2d09"
},
{
"carId": 4548,
Expand All @@ -241,7 +254,8 @@
"best_seller": true,
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://www.cartoq.com/wp-content/uploads/2021/09/XUV700-Dark-Knight-edition-featured.jpg",
"in_stock": false
"in_stock": false,
"id": "afa9"
},
{
"carId": 4752,
Expand All @@ -257,16 +271,18 @@
"best_seller": false,
"timestamp": "2004-10-19 10: 23: 54",
"poster": "https://paultan.org/image/2020/10/2021-Hyundai-i20-N-Exterior-7.jpg",
"in_stock": true
"in_stock": true,
"id": "2f24"
}
],
"orders": [
{
"id": "fa6b"
}
],
"users": [
{
"id": 1,
"id": "1",
"name": "Shivam Roy",
"email": "[email protected]",
"password": "helloreact"
Expand All @@ -275,7 +291,13 @@
"id": 2,
"name": "Deepak Kumar",
"email": "[email protected]",
"password": "Deepak@1234"
"password": "learnreact"
},
{
"id": 3,
"name": "test",
"email": "[email protected]",
"password": "helloreact"
}
]
}
6 changes: 3 additions & 3 deletions car-ui-react/src/pages/Register.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const Register = () => {
const [showPassword, setShowPassword] = useState(false);

const togglePasswordVisibility = () => setShowPassword(!showPassword);

const [users, setUsers] = useState([]); // State to hold users data

// Fetch the users data from the server
Expand All @@ -29,11 +29,11 @@ export const Register = () => {

const getNextId = () => {
const maxId = users.reduce(
(max, user) => (user.id > max ? user.id : max),
(max, user) => (parseInt(user.id, 10) > max ? parseInt(user.id, 10) : max),
0
);
return maxId + 1;
};
};

async function handleRegister(event) {
event.preventDefault();
Expand Down

0 comments on commit 646c47d

Please sign in to comment.