Support Topics Documentation Slack YouTube Blog

Update User with GeoPoint relationship - metadata ignored


(Bugdroid) #1

Im trying to update a User and update/create GeoPoint relationship at the same request. For this I request the following:
PUT: /data/Users/{_XXXX_UserObjectID_XXX}
BODY:

{
"firstname":"ABC",
"email": "abc@abc_domain.com",
"favoritePlace": {
"___class": "GeoPoint",
"categories": [
"Geo_Party"
],
"latitude": 51.11014399999999,
"longitude": 17.025433,
"metadata": {
"googlePlaceID": "ChIJnQ0s3grCD0cRg1YORUpe5GI",
"venueName": "Bezsenność"
}
}
}

With this request what will happen is that user parameters “firstname” and “email” will be updated, also “favoritePlace” will have a relationship to a new GeoPoint but without Metadata. I need the metadata to be stored and not ignored.
Am I missing something or do I need a separate request to create the GeoPoint. I noticed that if I do POST on Users with GeoPoint (when creating a user), it creates a new user with a new GeoPoint and its metadata (as expected).


(Anton Govorushkin) #2

Hello Bugdroid,

I’ve reproduced the behavior you described, request looks correct. As a workaround I’d recommend to keep this request for creating a point and establishing a relation with it, and to use a separate request for updating metadata.

I’ve created an internal ticket which you can reference by id 14038, we’ll notify as soon as it is fixed.

Regards Anton