wmiys / api.alpha

Api for the the backend
0 stars 0 forks source link

[product-categories]: add option to send all of them in separate lists #117

Closed rrickgauer closed 3 years ago

rrickgauer commented 3 years ago

if the user adds an optional flag to the url query: ?seperate_list=true

then return the json body as 3 lists:

  1. major
  2. minor
  3. sub
rrickgauer commented 3 years ago

The response body should look like:

{
    major: [
        {
            id: id,
            name: name
        },
    ],

    minor: [
        {
            id: id,
            parent_id: major_category_id,
            name: name,
        },
    ],

    sub: [
        {
            id: id,
            parent_id: minor_category_id,
            name: name,
        },
    ],
}