mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-01 19:17:47 +00:00
Fixing location/contact deletion.
This commit is contained in:
@@ -70,6 +70,8 @@ namespace OpenWifi{
|
||||
}
|
||||
|
||||
if(DB_.DeleteRecord("id",UUID)) {
|
||||
if(!Existing.entity.empty())
|
||||
Storage()->EntityDB().DeleteLocation("id",Existing.entity,UUID);
|
||||
return OK();
|
||||
}
|
||||
InternalError(RESTAPI::Errors::CouldNotBeDeleted);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenWifi{
|
||||
AddContactExtendedInfo(E, Obj);
|
||||
ObjArr.add(Obj);
|
||||
} else {
|
||||
return BadRequest(RESTAPI::Errors::UnknownId + " ("+i+")");
|
||||
return BadRequest(RESTAPI::Errors::ContactMustExist + " ("+i+")");
|
||||
}
|
||||
}
|
||||
Poco::JSON::Object Answer;
|
||||
|
||||
@@ -68,6 +68,9 @@ namespace OpenWifi{
|
||||
}
|
||||
|
||||
if(DB_.DeleteRecord("id",UUID)) {
|
||||
if(!Existing.entity.empty())
|
||||
Storage()->EntityDB().DeleteLocation("id",Existing.entity,UUID);
|
||||
|
||||
return OK();
|
||||
}
|
||||
InternalError(RESTAPI::Errors::CouldNotBeDeleted);
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenWifi{
|
||||
AddLocationExtendedInfo(E, Obj);
|
||||
ObjArr.add(Obj);
|
||||
} else {
|
||||
return BadRequest(RESTAPI::Errors::UnknownId + " ("+i+")");
|
||||
return BadRequest(RESTAPI::Errors::LocationMustExist + " ("+i+")");
|
||||
}
|
||||
}
|
||||
Poco::JSON::Object Answer;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace OpenWifi::RESTAPI::Errors {
|
||||
static const std::string CouldNotBeDeleted{"Element could not be deleted."};
|
||||
static const std::string NameMustBeSet{"The name property must be set."};
|
||||
static const std::string ConfigBlockInvalid{"Configuration block type invalid."};
|
||||
static const std::string UnknownId{"Unknown management policy."};
|
||||
static const std::string UnknownId{"Unknown UUID."};
|
||||
static const std::string InvalidDeviceTypes{"Unknown or invalid device type(s)."};
|
||||
static const std::string RecordNotCreated{"Record could not be created."};
|
||||
static const std::string RecordNotUpdated{"Record could not be updated."};
|
||||
|
||||
Reference in New Issue
Block a user