1
0
Fork 0

wip(markdown): Working on backend docs

This commit is contained in:
joostdecock 2022-11-19 19:52:59 +01:00
parent 6138a24f97
commit 749516af8e
19 changed files with 835 additions and 22 deletions

View file

@ -16,12 +16,12 @@ The details are outlined in the table below:
| | Public Patterns | Non-Public Patterns |
| ---------------: | :-------------: | :-----------------: |
| **Your own** | `0` or higher | `4` or higher |
| **Your own** | `0` or higher | `3` or higher |
| **Other user's** | `0` or higher | `5` or higher |
## Endpoints
Creating a new API key is possible via these endpoints:
Creating a new Person is possible via these endpoints:
| Method | Path | Authentication |
| --------: | :--- | :------------- |
@ -72,7 +72,7 @@ in the response body should indicate the nature of the problem.
## Example request
```js
const apiKey = axios.post(
const clone = axios.post(
'https://backend.freesewing.org/patterns/10/clone/jwt',
null,
{

View file

@ -6,7 +6,7 @@ Creates a new Pattern. This is typically used when users choose to save a patter
## Access control
- [Permission level](/reference/backend/api/rbac) `4` or higher is required to create a Pattern
- [Permission level](/reference/backend/api/rbac) `3` or higher is required to create a Pattern
## Endpoints
@ -36,14 +36,14 @@ Possible status codes for these endpoints are:
| Status code | Description |
| ----------: | :---------- |
| <StatusCode status="200"/> | success |
| <StatusCode status="201"/> | success |
| <StatusCode status="400"/> | the request was malformed |
| <StatusCode status="401"/> | the request lacks authentication |
| <StatusCode status="403"/> | authentication failed |
| <StatusCode status="500"/> | server error |
<Note>
If the status code is not <StatusCode status="200" /> the `error` property
If the status code is not <StatusCode status="201" /> the `error` property
in the response body should indicate the nature of the problem.
</Note>
@ -94,7 +94,7 @@ const pattern = await axios.post(
```
## Example response
```200.json
```201.json
{
"result": "success",
"pattern": {

View file

@ -6,7 +6,7 @@ Deletes an existing Pattern.
## Access control
- [Permission level](/reference/backend/api/rbac) `4` or higher is required to delete a Pattern
- [Permission level](/reference/backend/api/rbac) `3` or higher is required to delete a Pattern
- [Permission level](/reference/backend/api/rbac) `8` is required to delete **another user's** Pattern
## Endpoints

View file

@ -16,7 +16,7 @@ The details are outlined in the table below:
| | Public Patterns | Non-Public Patterns |
| ---------------: | :-------------: | :-----------------: |
| **Your own** | `0` or higher | `4` or higher |
| **Your own** | `0` or higher | `1` or higher |
| **Other user's** | `0` or higher | `5` or higher |
## Endpoints

View file

@ -3,11 +3,10 @@ title: Update a Pattern
---
Updates an existing Pattern.
This is typically used when users choose to save/overwrite a pattern.
## Access control
- [Permission level](/reference/backend/api/rbac) `4` or higher is required to update a Pattern
- [Permission level](/reference/backend/api/rbac) `3` or higher is required to update a Pattern
- [Permission level](/reference/backend/api/rbac) `8` is required to update **another user's** Pattern
## Endpoints