full
This commit is contained in:
16
controllers/application/countriesController.js
Normal file
16
controllers/application/countriesController.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const { CountryModel } = require('../../models/StateCity')
|
||||
|
||||
const getCountries = async (req, res, next) => {
|
||||
try {
|
||||
const countries = await CountryModel.find({}).sort({ name_fa: 1 })
|
||||
res.status(200).json({
|
||||
countries
|
||||
})
|
||||
} catch (err) {
|
||||
res.status(500).send('Internal Server Error')
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getCountries
|
||||
}
|
||||
Reference in New Issue
Block a user