You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement a seeder in such a way that it will check if you have an admin user present in your local db then insert it if its not present and ignore if an admin user is already present.
here is a sample document on how the admin user doc should look like in ur database after insertion:
"_id": { "$oid": "64114ad83d4089dedf268d44" },
"name": "Admin",
"email": "admin@email.com",
"password": "$2a$10$WSieBcoa3TI6JaAjPSVHjvj0pGJoANe/gJkK2yJXyqaQeoq", //hashed password 10 salt rounds
"type": "ADMIN USER",
"lastLogin": {
"$date": "2023-07-11T09:51:59.075Z"
},
"cts": {
"$date": "2023-03-15T04:34:32.566Z"
},
"mts": {
"$date": "2023-07-11T09:51:59.075Z"
},
"__v": 0,
"isLocked": false,
"assignedOrganisations": [ ],
"isDeleted": false
}```
### 🎤 Pitch
It makes codebase setup more streamlined and easier. implementing seeders is considered a good practice as it does not allow for much human error.
### 👀 Have you spent some time to check if this issue has been raised before?
- [X] I checked and didn't find similar issue
### 👀 Have you read the Code of Conduct?
- [X] I have read the [Code of Conduct](/~https://github.com/apiwizlabs/saleswiz/blob/main/CODE_OF_CONDUCT.md)
The text was updated successfully, but these errors were encountered:
🔖 Feature description
Implement a seeder in such a way that it will check if you have an admin user present in your local db then insert it if its not present and ignore if an admin user is already present.
We have setup seeders in our saleswiz - /~https://github.com/apiwizlabs/saleswiz repository
so please take a look at it helps you.
here is a sample document on how the admin user doc should look like in ur database after insertion:
The text was updated successfully, but these errors were encountered: