farmOS / farmOS.js

A JavaScript library for working with farmOS data structures and interacting with farmOS servers.
MIT License
15 stars 13 forks source link

Generalize the query parameters accepted by .get() requests #12

Closed jgaehring closed 3 years ago

jgaehring commented 4 years ago

Right now we can only accept the following parameters for farm.log.get() requests: type, done, log_owner and page. These are hardcoded with defaults so we restrict what kinds of requests can be sent. After some discussion with @mstenta and @paul121, I realize we should generalize this method so that any parameters can be accepted, and just let the request fail if the parameters are not structured properly. This will mean we won't have to update the library as frequently when there are changes to the farmOS API.

This is also necessary for expanding the type of logs Field Modules (farmOS/farmOS-client#241) can filter for when they are registered with Field Kit; for instance, I'd like the weather module to be able to filter by category so it can import and cache historical weather data.

jgaehring commented 3 years ago

Closing in favor of 2.x development.