dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #48587
Setting owner of object with API
Hi devs,
I’m trying to set the owner of an object using the API (using PATCH), but it fails.
Example (agains /demo):
curl -X PATCH -H «Content-Type: application/json" -u admin:district -d ‘{ "user": { "id": "dXKBEMfyChY" } }' "https://play.dhis2.org/demo/api/dataSets/kS1CX1YBcl1/user" -v
Result:
{«httpStatus":"Internal Server Error","httpStatusCode":500,"status":"ERROR","message":"object references an unsaved transient instance - save the transient instance before flushing: org.hisp.dhis.user.User"}
Is this a bug, or have I misunderstood how to do this?
Regards
Olav
Follow ups