new API page in docs

This commit is contained in:
les
2020-02-02 21:08:16 +01:00
parent 2bcf1fc9a0
commit a1073642b5
9 changed files with 185 additions and 10 deletions

View File

@@ -26,6 +26,20 @@ api.use(express.json())
* @category User
* @name /api/user
* @type GET
* @example **Response**
* ```json
{
"description" : null,
"recover_code" : "",
"id" : 1,
"createdAt" : "2020-01-29T18:10:16.630Z",
"updatedAt" : "2020-01-30T22:42:14.789Z",
"is_active" : true,
"settings" : "{}",
"email" : "eventi@cisti.org",
"is_admin" : true
}
```
*/
api.get('/user', isAuth, (req, res) => res.json(req.user))

View File

@@ -4,7 +4,7 @@ module.exports = (sequelize, DataTypes) => {
const User = sequelize.define('user', {
settings: {
type: DataTypes.JSON,
defaultValue: '{}'
defaultValue: []
},
email: {
type: DataTypes.STRING,