Add locker service methods for status change and key swap; create LockerMaintenance and LockerStatus components with form validation and translations

This commit is contained in:
2024-12-23 00:10:59 +05:30
parent 8cee8e0383
commit 9d72dc6868
8 changed files with 496 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
import api from './api';
export const lockersService = {
export const lockerService = {
registerLockers: async (cabinetId, lockers) => {
return api.post('/cabinet', {
cabinetId,
@@ -11,4 +11,12 @@ export const lockersService = {
}))
});
},
changeLockerStatus: async (cabinetId, lockerId, status) => {
return api.patch(`/locker/status`, { cabinetId, lockerId, status });
},
keySwap: async (cabinetId, lockerId, reason, oldKey, newKey) => {
return api.patch(`/locker/key`, { cabinetId, lockerId, reason, oldKey, newKey });
}
};