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

Accept an array of id's as a .get() parameter #7

Closed jgaehring closed 5 years ago

jgaehring commented 5 years ago

We'd like to be able to get logs (and potentially assets and areas, too), by passing in an array of id's (integers). Under the hood, this would format a query string in the format log.json?id[]=X&id[]=Y. An example: https://test.farmos.net/log.json?id[]=163&id[]=167 . The one limitation to this formatting is the URL string length, which shouldn't go over 2000 chars (see this SO post).

This would be useful in scenarios where a client has an arbitrary collection of certain logs, which can't be represented by a simple import filter, and wants to get updates on all of those logs from the server.

Field Kit has just such a use case (see farmOS/farmOS-client#198)

jgaehring commented 5 years ago

This was resolved by a423e6a.