raykeating / strapi-location-field-plugin

A Strapi plugin to enable a custom location field with autocomplete input
MIT License
21 stars 7 forks source link

API create / update #6

Closed martin-landhi closed 5 months ago

martin-landhi commented 1 year ago

Hi,

How should send the data thought REST api to create or update this custom field?

Really thanks for this work, works perfect.

raykeating commented 1 year ago

Hi, sorry for the late response, I must have missed this.

It's possible that Strapi might accept it if you simply send a JSON object with the same (or similar) key-value structure as the GET response? To be honest it's not something I thought about or tested when I initially built this plugin.

If that doesn't work, I do plan to look into support for this in the future, but I've been too busy for it lately. If someone would like to contribute this feature it would be much appreciated

raykeating commented 5 months ago

Can confirm this approach will work. Make sure you provide at least these fields:

{
    "description": "123 Street, New York, NY",
    "place_id": "place-id-returned-from-google-api",
    "lat": 100,
    "lng": 100
}
mvaisberg commented 5 months ago

Perfect @raykeating it works, thanks