feat(admin): implement region renaming functionality and update UI components

This commit is contained in:
Torsten Schulz (local)
2026-08-14 13:50:49 +02:00
parent a6a1ce7726
commit edb40c9785
6 changed files with 244 additions and 0 deletions

View File

@@ -57,6 +57,7 @@ class AdminController {
this.getFalukantAllRegions = this.getFalukantAllRegions.bind(this);
this.getFalukantRegionTypes = this.getFalukantRegionTypes.bind(this);
this.createFalukantRegion = this.createFalukantRegion.bind(this);
this.updateFalukantRegion = this.updateFalukantRegion.bind(this);
this.deleteFalukantRegion = this.deleteFalukantRegion.bind(this);
this.updateFalukantRegionMap = this.updateFalukantRegionMap.bind(this);
this.getRegionDistances = this.getRegionDistances.bind(this);
@@ -623,6 +624,19 @@ class AdminController {
}
}
async updateFalukantRegion(req, res) {
try {
const { userid: userId } = req.headers;
const region = await AdminService.updateFalukantRegion(userId, req.params.id, req.body || {});
res.status(200).json(region);
} catch (error) {
console.log(error);
const status = error.message === 'noaccess' ? 403
: (error.message === 'regionNotFound' ? 404 : 400);
res.status(status).json({ error: error.message });
}
}
async deleteFalukantRegion(req, res) {
try {
const { userid: userId } = req.headers;