DemocracyOS / core

1 stars 1 forks source link

User Model and DB-API #10

Closed guillecro closed 6 years ago

guillecro commented 6 years ago
Field Type
id ObjectId
keycloakId String
username String
avatar Blob
content Mixed

content has all the data related to the structure defined on the JSON schema declared inside community for profiles

guillecro commented 6 years ago

Closing for now, will re-open it if needed.

guillecro commented 6 years ago

Updated the user schema after we defined that the custom fields will be defined inside the community schema

guillecro commented 6 years ago

Changelog for recent commit 90a9023

Note: After thinking a lot about it, I added my middleware that binds the user data with the current sesson WHEN there is a logged user in the session. Cause, for example, if i want to update my user info, i can just call PUT /api/v1/users and update my own data. Also I can use the req.session.user data when creating documents or in other cases. Its better this way, so you don't depend on the fronted to send you the "correct" id when, for example, creating a document.

guillecro commented 6 years ago

Working as expected! Note: I changed the data type for avatar to String, while we think what to do with the images