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

'Invalid document structure: Attribute "gender" has invalid format. Value must be one of (male, female, other)' #57

Open
TranPhu45 opened this issue Oct 2, 2024 · 1 comment

Comments

@TranPhu45
Copy link

TranPhu45 commented Oct 2, 2024

An error occurred while retrieving the patient details: SyntaxError: "undefined" is not valid JSON
at JSON.parse ()
at parseStringify (webpack-internal:///(rsc)/./lib/utils.ts:17:38)
at $$ACTION_3 (webpack-internal:///(rsc)/./lib/actions/patient.actions.ts:85:70)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Register (webpack-internal:///(rsc)/./app/patients/[userId]/register/page.tsx:31:21)
GET /patients/66fd04f9003d1c1b2a51/register?_rsc=lzpiz 200 in 1339ms
An error occurred while creating a new patient: AppwriteException [Error]: Invalid document structure: Attribute "gender" has invalid format. Value must be one of (male, female, other)
at Client.call (webpack-internal:///(rsc)/./node_modules/node-appwrite/lib/client.js:206:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Databases.createDocument (webpack-internal:///(rsc)/./node_modules/node-appwrite/lib/services/databases.js:1711:16)
at async $$ACTION_2 (webpack-internal:///(rsc)/./lib/actions/patient.actions.ts:66:28)
at async C:\Users\Admin\PycharmProjects\PatientManagementSystem\healthcare\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:39:418
code: 400,
type: 'document_invalid_structure',
response: {
message: 'Invalid document structure: Attribute "gender" has invalid format. Value must be one of (male, female, other)',
code: 400,
type: 'document_invalid_structure',
version: '1.6.0'
}
}
POST /patients/66fd04f9003d1c1b2a51/register 200 in 1731ms

@theTechbug
Copy link

Screenshot 2024-10-16 235340
when you are creating database in appwrite . In patient collection when you are selecting enum for gender see to it that you capitalize the first letter like Male,Female , Other option is in constant file just make the first letter small

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

No branches or pull requests

2 participants