Update some crud endpoints

This commit is contained in:
rui hildt 2020-03-23 17:55:47 +01:00
parent ab1c54461f
commit d0a8c17089

View File

@ -14,8 +14,8 @@ ___
| latest_time | string | | | latest_time | string | |
| created_at | datetime | generated by database | | created_at | datetime | generated by database |
#### Add an account #### Register an account
**`POST /api/account`** **`POST /api/account/register`**
##### Request ##### Request
A json object for the user to register with **`username`**, **`email`**, **`password`**, `timezone`, `earliest_time` and `latest_time`. A json object for the user to register with **`username`**, **`email`**, **`password`**, `timezone`, `earliest_time` and `latest_time`.
@ -46,7 +46,7 @@ A json object for the registered user with `id`, `username`, `email`, `timezone`
``` ```
#### Update an account #### Update an account
**`PUT /api/account/:id`** **`PUT /api/account/:id/profile`**
##### Request ##### Request
A json object for the user to register with `id` and any of `username`, `email`, `password`, `timezone`, `earliest_time`, `latest_time`. A json object for the user to register with `id` and any of `username`, `email`, `password`, `timezone`, `earliest_time`, `latest_time`.
@ -96,7 +96,7 @@ A json object for the deleted user with `username` and `email`.
``` ```
#### Log in an account #### Log in an account
**`POST /api/account`** **`POST /api/account/login`**
##### Request ##### Request
A json object for the user to login with either **`email`** or **`username`**, and **`password`** . A json object for the user to login with either **`email`** or **`username`**, and **`password`** .
@ -109,7 +109,7 @@ A json object for the user to login with either **`email`** or **`username`**, a
``` ```
##### Response ##### Response
A json object with the logged in user with `username` and `email`. A json object for the registered user with `id`, `username`, `email`, `timezone`, `earliest_time` and `latest_time`.
``` ```
{ {