adrianhajdin / healthcare

Build a healthcare platform that streamlines patient registration, appointment scheduling, and medical records, and learn to implement complex forms and SMS notifications.
https://jsmastery.pro
1.81k stars 432 forks source link

Nothing is happening when submit is clicked on the registeration form #22

Open meniscus44 opened 2 months ago

meniscus44 commented 2 months ago

No error is seen in the console. I also tried to console log inside the onSubmit function but nothing is logged, so the onSubmit function is not triggering. Not sure what the issue is. Link to my repo https://github.com/meniscus44/careplus Thanks in advance

ghost commented 2 months ago

I think issue is in appwrite file for some reason process.env is not deconstructing the values correctly and you have to set endpoints manually. client.setEndpoint("https://cloud.appwrite.io/v1").setProject("here project id").setKey("here api key.");

Muhammadhassan1226 commented 1 month ago

@ShadowFeather1861 This trick is not working I have same issue and stuck on it since 4 days

nahor-28 commented 1 month ago

Yes, not working. I am stuck too. Is this a appwrite issue?

bobbywilliamajor commented 1 month ago

The problem is because PROJECT_ID and API_KEY environment variables are not been accessed in the browser.

Make the following modifications to your env.local file

NEXT_PUBLIC _PROJECT_ID ="********"
NEXT_PUBLIC_API_KEY = "**********"

Make the following to your appwrite.config.tsx

export const {
    NEXT_PUBLIC_ENDPOINT: ENDPOINT,
    NEXT_PUBLIC_PROJECT_ID: PROJECT_ID,
    NEXT_PUBLIC_API_KEY: API_KEY,
    DATABASE_ID,
    PATIENT_COLLECTION_ID,
    DOCTOR_COLLECTION_ID,
    APPOINTMENT_COLLECTION_ID,
    NEXT_PUBLIC_BUCKET_ID: BUCKET_ID,
  } = process.env;
nahor-28 commented 1 month ago

@bobbywilliamajor did this but still not working. The submit button just loads and nothing happens, i get POST /200 message in the console but the data is not recorded in the appwrite patient collection.

nahor-28 commented 1 month ago

@bobbywilliamajor did this but still not working. The submit button just loads and nothing happens, i get POST /200 message in the console but the data is not recorded in the appwrite patient collection.

it is working now. thank you. silly typo was the isssue.

BalajiUmapathy commented 1 month ago

@ bobbywilliamajor i cant still fix the issue .it is no response. not loading too

Teegreat commented 1 month ago

@ bobbywilliamajor i cant still fix the issue .it is no response. not loading too

Could you compare your code to mine to check for errors?

make sure the enum values for gender start with a lowercase and the names of your inputs correspond to your attributes on appwrite.

https://github.com/Teegreat/hospital-mgt/tree/3f5886da040d3f7afb8ffff2dc5c90ee5a7d5aa7

milosmekota commented 1 month ago

check if you are using "use server" in patient.actions.ts

nihalsheikh commented 1 month ago

Finally solved this error by adding: 'use server' on top of the patient.actions.ts file