Skip to content

Commit

Permalink
changed website link to darpan id , changed paws version
Browse files Browse the repository at this point in the history
* Update package.json and NgoRegister.jsx

* Update .env.sample and package.json
  • Loading branch information
codewarnab authored Apr 20, 2024
1 parent 4544afd commit 6c46410
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 24 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aniresfr",
"version": "0.1.0",
"name": "paws",
"version": "1.0.0",
"private": true,
"dependencies": {
"@cloudinary/react": "^1.11.2",
Expand Down
22 changes: 5 additions & 17 deletions src/pages/ngo/NgoRegistration/NgoRegister.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function NgoRegisterForm() {
const [error, setError] = useState("");
const [state, setButtonState] = useState("idle");
const [lcation, setLocation] = useState("");
const [websiteLink, setWebsite] = useState("");
const [darpanid, setDarpanid] = useState("");
const [latitude, setLatitude] = useState(0);
const [longitude, setLongitude] = useState(0);
useEffect(() => {
Expand Down Expand Up @@ -176,10 +176,10 @@ function NgoRegisterForm() {
className="placeholder-stone h-16 bg-opacity-45 backdrop-blur-[6px] w-80 px-4 py-2 items-center outline-0 rounded-[30px] text-black text-lg bg-white shadow-dashBoardCardImageShadow"
type="text"
placeholder=" NGO-DARPAN ID (STATE/YEAR/ID)"
value={websiteLink}
value={darpanid}
onChange={(e) => {
setError("");
setWebsite(e.target.value);
setDarpanid(e.target.value);
}
}
/>
Expand All @@ -194,18 +194,7 @@ function NgoRegisterForm() {
successText="Logging In"
errorText="Register"
messageDuration={3000}
onClick={async () => {
// console.log(
// orgName,
// phoneNumber,
// email,
// emergency,
// password,
// animalSupported,
// lcation,
// websiteLink,
// latitude,
// longitude);
onClick={async () => {
registration(
orgName,
phoneNumber,
Expand All @@ -214,13 +203,12 @@ function NgoRegisterForm() {
password,
animalSupported,
lcation,
websiteLink,
darpanid,
latitude,
longitude,
setError,
setButtonState
);
// console.log("BAKA"); hai hai subarashi
}}
/>
{error && <p className="absolute top-[-25px] tracking-wide text-red-500 font-semibold text-center">{error}</p>}
Expand Down
10 changes: 5 additions & 5 deletions src/utils/Functions/ngoAuthService.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ngoValidator } from "./ngoValidator";
* @returns {void}
* @throws {Error} Throws an error if the email or phone number is not valid or if there's an error during the registration process.
*/
export const registration = async (orgName, phoneNumber, email, emergency, password,animalSupported, location, websiteLink, latitude, longitude, setError, setButtonState) => {
export const registration = async (orgName, phoneNumber, email, emergency, password,animalSupported, location, darpanid, latitude, longitude, setError, setButtonState) => {
// Validate the email address
if (!isValidEmail(email)) {
setError("Enter a valid email address.");
Expand All @@ -37,7 +37,7 @@ export const registration = async (orgName, phoneNumber, email, emergency, passw
setError("Enter a valid emergency contact number.");
return;
}
if (!(await ngoValidator(websiteLink, setError))) {
if (!(await ngoValidator(darpanid, setError))) {
setError("Enter a valid DARPAN ID");
return;
}
Expand All @@ -57,9 +57,9 @@ export const registration = async (orgName, phoneNumber, email, emergency, passw
email: email,
password: password,
emergency_contact_number: emergency,
animals_supported: animalSupported, // You need to replace this with the actual data
website: websiteLink,
address: location, //You need to replace this with the actual data
animals_supported: animalSupported,
website: darpanid,
address: location,
latitude: latitude,
longitude: longitude,
}
Expand Down

0 comments on commit 6c46410

Please sign in to comment.