rebus-ink / ink-API

Hobb API Server: backend for the Rebus Reader system
GNU Affero General Public License v3.0
4 stars 5 forks source link

create and update note with tags #601

Closed Marie000 closed 4 years ago

Marie000 commented 4 years ago

POST /notes now accepts a 'tags' property, which will be an array of tags. This is for all types of tags (flags, colour, stacks...) You can pass in an existing tag or a new tag. Existing tags should have an 'id' property. The API doesn't actually care about other properties. Tags that don't have an id will be created.

PUT /notes/:id also accepts a 'tags' property. It will overwrite existing tags for that note. Once again, it accepts new or existing tags. If the 'tags' property is an empty array, it will remove existing tags for the note. If it is null / undefined, it will not change anything.

In both cases, the response body will NOT include the tags. If we need it later, I can add it, but it will mean adding another database query.

I also re-introduced NOTE_TAG models tests, which had been disabled a while ago.