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.
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.