order pages all done and stock pages coming

Former-commit-id: da90fc25deecf2843a6269d877387ce07fdb2728
This commit is contained in:
Ben
2022-04-29 15:04:30 +01:00
parent b7cf3d44aa
commit d5bf2f03cd
17 changed files with 525 additions and 44 deletions

View File

@@ -10,27 +10,30 @@ automatically every request
| Type | Route | Queries | Auth? | Notes |
| --- | --- | --- | - | --- |
| GET | /api/special/ | | ❌ | |
| GET | /api/search/ | query (q), page | ❌ | Query endpoint |
| GET | /api/sets/featured | page | ❌ | Query endpoint |
| GET | /api/brick/:id | | ❌ | |
| POST | /api/bulk/brick | array | ❌ | POST due to bulk nature |
| GET | /api/set/:id | | ❌ | |
| GET | /api/cdn/:id | | ❌ | |
| GET | /api/basket/price/ | | ❌ | |
| GET | /api/discount/ | offer code | ❌ | |
| POST | /api/order/ | | ❌ | IF user is authenticated, auth/bearer will be sent and done manually without middleware |
| GET | /api/auth/order/:id | | ❌ | Security By Obscurity |
| GET | /api/auth/login/ | | ✔️ | |
| GET | /api/auth/orders/ | | ✔️ | |
| GET | /api/special/ | | ❌ | |
| GET | /api/search/ | query (q), page | ❌ | Query endpoint |
| GET | /api/sets/featured | page | ❌ | Query endpoint |
| GET | /api/brick/:id | | ❌ | |
| POST | /api/bulk/brick | array | ❌ | POST due to bulk nature |
| GET | /api/set/:id | | ❌ | |
| GET | /api/cdn/:id | | ❌ | |
| GET | /api/basket/price/ | | ❌ | |
| GET | /api/discount/ | offer code | ❌ | |
| POST | /api/order/ | | ❌ | IF user is authenticated, auth/bearer will be sent and done manually without middleware |
| GET | /api/auth/order/:id | | ❌ | Security By Obscurity |
| GET | /api/auth/login/ | | ✔️ | |
| GET | /api/auth/orders/ | | ✔️ | |
| GET | /api/auth/staff/orders/ | | ✔️ | All unshipped orders |
| PUT | /api/auth/staff/order/:id | | ✔️ | Update order to shipped, recieved (carrier) |
| PUT | /api/auth/staff/stock/:type/:id | | ✔️ | Update stock on item |
| POST | /api/auth/staff/stock/ | | ✔️ | Add item to inventory |
| DEL | /api/auth/staff/stock/:type/:id | | ✔️ | Remove item from inventory |
Query endpoints do not return the full data on a brick/set, they return
a subset for product listing pages
## Query structure
## Query parameters
For all endpoints that query, the following parameters are supported:
q: string to search for (fuzzy)