ADD: Get-Self endpoint for users ADD: Category and Role Seeder FIX: Login Check Bug ADD: Extra fields for documents and images in belonging model ADD: localhost:5173 to cors ADD: SuperAdmin ID to env
37 lines
982 B
JavaScript
37 lines
982 B
JavaScript
const Role = require('./roleModel')
|
|
const chalk = require('chalk')
|
|
|
|
const runSeeder = async () => {
|
|
const roles = [
|
|
{
|
|
_id: '66a0144569a37efa10d13628',
|
|
englishName: 'Admin',
|
|
nativeName: 'ادمین',
|
|
permissions: ['66a014057b80c4788e41aab7'],
|
|
isActive: true,
|
|
},
|
|
{
|
|
_id: '66a2da5b9b989a8909948848',
|
|
englishName: 'SuperAdmin',
|
|
nativeName: 'ادمین اصلی',
|
|
permissions: [],
|
|
isActive: true,
|
|
},
|
|
{
|
|
_id: '66a0144569a37efa10d13629',
|
|
englishName: 'User',
|
|
nativeName: 'کاربر',
|
|
permissions: [],
|
|
isActive: true,
|
|
},
|
|
]
|
|
|
|
await Role.deleteMany({})
|
|
console.log(chalk.red('Deleted all role records.'))
|
|
|
|
await Role.create(roles, null)
|
|
console.log(chalk.green.bold(`ROLE: Created ${roles.length} role(s)`))
|
|
}
|
|
|
|
module.exports = { runSeeder }
|