add delete mapping route, controller and implementation
This commit is contained in:
@@ -73,6 +73,10 @@ const getMappingsFromDatabase = () => {
|
||||
return db.officeResourceMapping.findAll();
|
||||
};
|
||||
|
||||
const deleteMappingById = (id) => {
|
||||
return db.officeResourceMapping.destroy({where: {id}});
|
||||
};
|
||||
|
||||
const saveNewMappingToDatabase = (mapping) => {
|
||||
return db.officeResourceMapping.findOrCreate({where: {...mapping}, defaults: {...mapping}});
|
||||
};
|
||||
@@ -83,4 +87,5 @@ module.exports = {
|
||||
fetchResources,
|
||||
getResourceMappings,
|
||||
saveNewMappingToDatabase,
|
||||
deleteMappingById,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user