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

Abstract vocabulary lookup into the term.send() method #6

Closed jgaehring closed 3 years ago

jgaehring commented 5 years ago

It would be nice if the library's caller didn't have to do a vocabulary lookup manually if they already knew the machine name of the vocabulary of the term they're trying to create/update, but just don't know the vid.

To achieve this, we could allow the caller to send a log with a vocabulary property which is either an object, containing the vocabulary's id, as required by the server, or it could just be string, corresponding to the machine name of the vocabulary. Under the hood, the .send() method could call vocabulary.(machine_name) to get the vid before sending the POST/PUT request for the term.

jgaehring commented 3 years ago

Closing in favor of 2.x development.