Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Changing a user role from volunteer -> parent fails with error #1281

@glenpike

Description

@glenpike

I had a parent sign-up as a volunteer by mistake. I was told that I could change their role, so accepted, then tried this out.

I got an error on the screen (need to look at error messages??):

Screenshot 2019-10-15 at 10 43 36

The request POST: https://zen.coderdojo.com/api/2.0/dojos/save-usersdojos with body:

{"userDojo":{"entity$":"-/cd/usersdojos","id":"81e5e435-74c6-43bd-91b7-c244f1f12fd1","mysqlUserId":null,"mysqlDojoId":null,"owner":null,"userId":"a9ff105a-ff5c-48c3-8708-a8ef253bf26a","dojoId":"5b14872f-abfb-4c4c-8f41-05de94c9a958","userTypes":["parent-guardian"],"userPermissions":[],"backgroundChecked":false,"deleted":0,"deletedBy":null,"deletedAt":null}}

Errors with the following:

{"statusCode":400,"error":"Bad Request","message":"child \"userDojo\" fails because [child \"owner\" fails because [\"owner\" must be a number]]","validation":{"source":"payload","keys":["userDojo.owner"]}}

Paired with Ant and tried copying the request and running as cURL, but changing the owner value to 0 as we assumed that the champion === owner, the message that came back was:

{"error":"You cannot change your ownership status"}

So guessing there's some issue there :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions