Room Office Mapping / Home screen now functional / Bugfixes
This commit is contained in:
@@ -70,7 +70,19 @@ const getResourceMappings = () => {
|
||||
};
|
||||
|
||||
const getMappingsFromDatabase = () => {
|
||||
return db.officeResourceMapping.findAll();
|
||||
return db.officeResourceMapping.findAll({order: [['id']]});
|
||||
};
|
||||
|
||||
const deleteMappingById = (id) => {
|
||||
return db.officeResourceMapping.destroy({where: {id}});
|
||||
};
|
||||
|
||||
const updateMappingById = (id, mapping) => {
|
||||
if (mapping.id) {
|
||||
delete mapping.id;
|
||||
}
|
||||
|
||||
return db.officeResourceMapping.update(mapping, {where: {id}});
|
||||
};
|
||||
|
||||
const saveNewMappingToDatabase = (mapping) => {
|
||||
@@ -83,4 +95,6 @@ module.exports = {
|
||||
fetchResources,
|
||||
getResourceMappings,
|
||||
saveNewMappingToDatabase,
|
||||
deleteMappingById,
|
||||
updateMappingById,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user