'Correct way to POST categories & optional sub-categories through an API
I am working on an API where a UX form has a drop-down with Categories in it. Some (not all) of those Categories also then have a sub-category (so a second drop-down appears when certain Categories are selected).
I was wondering what the best practice is in terms of sending that data through to a backend API would be. Should the API just accept a single category (be it 'category' or 'sub-category') or should the API accept both the sub-category and the category?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
