FIX: UserSeeder

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
This commit is contained in:
2025-01-03 17:45:09 +03:30
parent bda5bca9de
commit 465b678357
11 changed files with 180 additions and 12 deletions
+22
View File
@@ -0,0 +1,22 @@
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 }