feat(backend, frontend): Hinzufügen von Funktionen zur Verwaltung von Lagerbeständen im Falukant-System
- Implementierung von Methoden zur Hinzufügung und Abfrage von Lagerbeständen im AdminController und AdminService. - Erweiterung der Routen im AdminRouter zur Unterstützung der neuen Lagerverwaltungsfunktionen. - Anpassung der Benutzeroberfläche zur Integration eines Dialogs für die Lagerhinzufügung und zur Anzeige von Lagertypen. - Aktualisierung der Übersetzungen in den Sprachdateien für die neuen Funktionen und Fehlermeldungen.
This commit is contained in:
@@ -15,6 +15,8 @@ class AdminController {
|
||||
this.changeFalukantUser = this.changeFalukantUser.bind(this);
|
||||
this.getFalukantUserBranches = this.getFalukantUserBranches.bind(this);
|
||||
this.updateFalukantStock = this.updateFalukantStock.bind(this);
|
||||
this.addFalukantStock = this.addFalukantStock.bind(this);
|
||||
this.getFalukantStockTypes = this.getFalukantStockTypes.bind(this);
|
||||
this.getRoomTypes = this.getRoomTypes.bind(this);
|
||||
this.getGenderRestrictions = this.getGenderRestrictions.bind(this);
|
||||
this.getUserRights = this.getUserRights.bind(this);
|
||||
@@ -164,6 +166,29 @@ class AdminController {
|
||||
}
|
||||
}
|
||||
|
||||
async addFalukantStock(req, res) {
|
||||
try {
|
||||
const { userid: userId } = req.headers;
|
||||
const { branchId, stockTypeId, quantity } = req.body;
|
||||
const response = await AdminService.addFalukantStock(userId, branchId, stockTypeId, quantity);
|
||||
res.status(200).json(response);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
res.status(403).json({ error: error.message });
|
||||
}
|
||||
}
|
||||
|
||||
async getFalukantStockTypes(req, res) {
|
||||
try {
|
||||
const { userid: userId } = req.headers;
|
||||
const response = await AdminService.getFalukantStockTypes(userId);
|
||||
res.status(200).json(response);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
res.status(403).json({ error: error.message });
|
||||
}
|
||||
}
|
||||
|
||||
async getRoomTypes(req, res) {
|
||||
try {
|
||||
const userId = req.headers.userid;
|
||||
|
||||
Reference in New Issue
Block a user