app-generator / api-server-nodejs

Nodejs API Server - Express / SQLite / TypeORM | AppSeed
https://appseed.us/boilerplate-code/nodejs-starter/
Other
227 stars 87 forks source link

Default User Role - Save NULL Value #25

Open app-generator opened 1 year ago

app-generator commented 1 year ago

On Creation, the user should be assigned to the "USER" role = value 2

Currently, the users are created with a NULL value for the ROLE column.

Here is the response to the registration request:

{
    "success": true,
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImE2Nzc4NDViLTEwODctNDliOS05N2I1LTlkYzM1YWFlYTE0YyIsInVzZXJuYW1lIjoidGVzdCIsImVtYWlsIjoidGVzdEBhcHBzZWVkLnVzIiwiaWF0IjoxNjY5NzM1NTczLCJleHAiOjE2Njk4MjE5NzN9.9Lg4Ryw75xLd4iOl-V3Pp-lx9rt6zjXfc5DYTCYhvYQ",
    "user": {
        "id": "a677845b-1087-49b9-97b5-9dc35aaea14c",
        "username": "test",
        "email": "test@appseed.us",
        "date": "2022-11-29T15:21:51.000Z",
        "user_role": null
    }
}
shiva5152 commented 6 months ago

could you explain it a bit more