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

data fetching with the delay message & Feature Validate AddBooking #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AbdihamidAli
Copy link
Collaborator

I did not know that input validation is another feature called validate AddBookings. so this PR is for two features. and I did a stretch validation to check if the room is booked

Copy link
Collaborator

@adniyaYousaf adniyaYousaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done. I have requested some changes.

const [error, setError] = useState(null);

// Function to check the email format
const isValidEmail = (email) => {
Copy link
Collaborator

@adniyaYousaf adniyaYousaf Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why didn't you use the pattern attribute to add validation on email input indead of creating a new funtion? Like here https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email

alert("Please fill in all required fields.");

// Validation for first name, last name, email, and room ID
if (
Copy link
Collaborator

@adniyaYousaf adniyaYousaf Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Input element have attribute required to validate that input id filled or not.
look into this https://www.w3schools.com/js/js_validation.asp

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That because it's only works on the HTML on react I'm trying to check if any of the fields are empty, that's what I understood when I was testing the validation function. It would make an extra line if I added the required attribute on the input fields

@@ -1,97 +1,97 @@
// Bookings.scss

.bookings {
padding: 20px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The styles looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants