You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.
{"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 :)
The text was updated successfully, but these errors were encountered:
Owner is a flag used for representing the current owner of the Dojo. There should be only one per Dojo, and only the owner of the Dojo can pass this ownership to somebody else (nb, that's never been enforced in the DB).
As per se, forcing the owner in the payload to 0 won't help as https://github.com/CoderDojo/cp-dojos-service/blob/master/lib/save-usersdojo.js#L36 checks for "any" mutation.
The fact that the owner value is missing from the payload is weird by itself, as I don't believe we mutate the payload (at least not that field) in the frontend. Note however that the DB does not enforce it that field to be set. If users are being created without the owner flag (not 0 nor 1), it might create some issues in the future, but I havent been able to reproduce it in dev (adding children through My children page or the booking flow). You might want to check the prod if there are any relationship (cd_usersdojos) not having a "owner" set to anything but 0 or 1.
I did try with a newly created volunteer account (joined through the "Join" button, my previous comment was indeed describing another flow, my bad), and had no issue on the dev stack. It could be that the user is also a parent, that it's an old account that might be glitched (ref previous comment), or ..?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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??):
The request
POST: https://zen.coderdojo.com/api/2.0/dojos/save-usersdojos
with body:Errors with the following:
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:
So guessing there's some issue there :)
The text was updated successfully, but these errors were encountered: