PetMe is an all-in-one platform that allows animals to be adopted, donated to pet lovers, and provides emergency medical care to stray animals in need. Star this repo⭐
Describe the bug
The current implementation of the phone field in the donationSchema is using the Number type and the trim option, which is not valid for numbers. Additionally, this could lead to the mishandling of phone numbers with leading zeros or country codes.
To Reproduce
Steps to reproduce the behavior:
1.) Go to the form where donations are submitted.
2.) Enter a phone number with leading zeros or a country code (e.g., +1234567890).
3.) Submit the form.
4.) Observe that the phone number is not stored correctly in the database, potentially leading to loss of leading zeros or errors in saving the document.
Expected behavior
Phone numbers should be stored as strings to preserve formatting, including leading zeros and country codes. The trim option should not be used with the phone field.
Screenshots
Description: This screenshot shows the donation form with the phone number field filled with the number "+1234567890"and the form not showing error for invalid number.
Desktop (please complete the following information):
OS: Windows 10
Browser Chrome
Version 91.0
Smartphone (please complete the following information):
Device: iPhone 12
OS: iOS 14.6
Browser Safari
Version 14
Additional context
The phone number should be validated using a proper validation function to ensure it conforms to a valid phone number format.
Please assign me this issue under GSSOC'24 to solve this bug.
I hope you're doing great! As a SSOC contributor, I'm keen on ramping up my involvement for SSOC'24. Could you please assign this issue to me? I'm excited to continue contributing to the project. Thanks a bunch!
Describe the bug The current implementation of the phone field in the donationSchema is using the Number type and the trim option, which is not valid for numbers. Additionally, this could lead to the mishandling of phone numbers with leading zeros or country codes.
To Reproduce Steps to reproduce the behavior:
1.) Go to the form where donations are submitted. 2.) Enter a phone number with leading zeros or a country code (e.g., +1234567890). 3.) Submit the form. 4.) Observe that the phone number is not stored correctly in the database, potentially leading to loss of leading zeros or errors in saving the document.
Expected behavior Phone numbers should be stored as strings to preserve formatting, including leading zeros and country codes. The trim option should not be used with the phone field.
Screenshots Description: This screenshot shows the donation form with the phone number field filled with the number "+1234567890"and the form not showing error for invalid number.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context The phone number should be validated using a proper validation function to ensure it conforms to a valid phone number format. Please assign me this issue under GSSOC'24 to solve this bug.