thetawom / culd-hub

Show management software for Columbia University Lion Dance
3 stars 0 forks source link

Set up user profile frontend functionality #6

Closed thetawom closed 2 years ago

thetawom commented 2 years ago

Call mutation #5 from profile page to edit the following user profile information:

Change password feature should probably be implemented separately with a different API.

Part of larger ongoing issue #2.

thetawom commented 2 years ago

Backend mutation is set up and ready to go. Sample query:

mutation EditUser (
        $email: String!
        $firstName: String!
        $lastName: String!
        $phone: String!
        $classYear: String!
        $school: String!
    ) {
    editUser(
        email: $email
        firstName: $firstName
        lastName: $lastName
        phone: $phone
        classYear: $classYear
        school: $school
    )  {
        user {
            id
            firstName
            lastName
            email
            phone
            member {
                classYear
                school
            }
        }
    }
}

All of the parameters are optional, and the mutation can return the modified user object (see above). The user state held in UserContext should be updated with the edited user that is returned.

thetawom commented 2 years ago

Set up Form for each profile item to fetch user input and allow validation with rules.

catw101 commented 2 years ago

Done.