Додана сторінка "історія служіння"
This commit is contained in:
26
api/controllers/history.apartment.controller.js
Normal file
26
api/controllers/history.apartment.controller.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const historyApartmentService = require('../services/history.apartment.service');
|
||||
|
||||
class historyApartmentController {
|
||||
async getList(req, res) {
|
||||
const { limit } = req.query;
|
||||
|
||||
if (req.mode == 2) {
|
||||
let result = await historyApartmentService.getList(limit);
|
||||
if (result) {
|
||||
return res
|
||||
.status(200)
|
||||
.send(result);
|
||||
} else {
|
||||
return res
|
||||
.status(500)
|
||||
.send({ message: 'Internal server error.' });
|
||||
}
|
||||
} else {
|
||||
return res
|
||||
.status(403)
|
||||
.send({ message: 'The user does not have enough rights.' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new historyApartmentController();
|
||||
Reference in New Issue
Block a user