Closed keawade closed 4 years ago
The user could probably also see some enhancements as far as what lives on the object, but that's another issue.
After looking further, at the moment, there are actually no properties on the user object that I want to be changeable.
What did you have in mind?
Users should probably have a unique id so they can change their username/displayname/email/whatever. Whatever those extra fields beyond unique id and password are, they should be changeable (probably).
Users do have a unique id, but for friendliness we do everything by username.. Which could be changeable I suppose, it just adds to the chance that someone will forget their login information..
Email doesn't exist currently, but should if we want to be able to send out email alerts or compilations of recent content.
We need a unique identifier for navigation to their profile and also for a login username. These don't have to be the same field.
If we're masking usernames behind display names, do we want to navigate with usernames? I think we might want to use their user ids instead.
I think it is still best to navigate with username. Even if you can change your display name, username makes a nice constant, and far nicer looking urls than id
s
Okay so it looks like we've got this structure for users then:
{
username: string;
displayname: string;
posts: Array<PostObject>;
following: Array<UserObject>;
followers: Array<UserObject>;
}
I think we should drop all but user name and display name when returning arrays of UserObjects or posting a UserObject.
A user should have something like the following route
PUT
orPOST
/user/:userid
expects a user object to update the stored user object.