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
23 lines
622 B
JavaScript
23 lines
622 B
JavaScript
const Category = require('./categoryModel')
|
|
const chalk = require('chalk')
|
|
|
|
const runSeeder = async () => {
|
|
const categories = [
|
|
{ nativeName: 'ساختمان', englishName: 'Building' },
|
|
{ nativeName: 'زمین', englishName: 'Lot' },
|
|
{ nativeName: 'کالا', englishName: 'Product' },
|
|
]
|
|
|
|
await Category.deleteMany({})
|
|
console.log(chalk.red('Deleted all category records.'))
|
|
|
|
await Category.create(categories, null)
|
|
console.log(
|
|
chalk.green.bold(
|
|
`CATEGORY: Created ${categories.length} category(ies)`
|
|
)
|
|
)
|
|
}
|
|
|
|
module.exports = { runSeeder }
|