mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-02 03:27:51 +00:00
Allowing signup in the default entity.
This commit is contained in:
@@ -41,10 +41,6 @@ namespace OpenWifi{
|
||||
return BadRequest(RESTAPI::Errors::CannotDeleteRoot);
|
||||
}
|
||||
|
||||
if(Existing.type=="subscriber" && Existing.defaultEntity) {
|
||||
return BadRequest(RESTAPI::Errors::CannotDeleteSubEntity);
|
||||
}
|
||||
|
||||
if( !Existing.children.empty() || !Existing.devices.empty() || !Existing.venues.empty() || !Existing.locations.empty()
|
||||
|| !Existing.contacts.empty() || !Existing.configurations.empty()) {
|
||||
return BadRequest(RESTAPI::Errors::StillInUse);
|
||||
@@ -54,7 +50,6 @@ namespace OpenWifi{
|
||||
DB_.DeleteRecord("id",UUID);
|
||||
DB_.DeleteChild("id",Existing.parent,UUID);
|
||||
return OK();
|
||||
|
||||
}
|
||||
|
||||
void RESTAPI_entity_handler::DoPost() {
|
||||
@@ -73,14 +68,6 @@ namespace OpenWifi{
|
||||
return BadRequest(RESTAPI::Errors::InvalidJSONDocument);
|
||||
}
|
||||
|
||||
if(NewEntity.type.empty()) {
|
||||
NewEntity.type = "normal";
|
||||
}
|
||||
|
||||
if(!ValidEntityType(NewEntity.type)) {
|
||||
return BadRequest(RESTAPI::Errors::InvalidEntityType);
|
||||
}
|
||||
|
||||
if(!ProvObjects::CreateObjectInfo(Obj,UserInfo_.userinfo,NewEntity.info)) {
|
||||
return BadRequest(RESTAPI::Errors::NameMustBeSet);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user