Call exclude() when updating status to -2
This commit is contained in:
parent
39fba3c4a9
commit
d979440ca6
@ -329,7 +329,7 @@ class Members extends DolibarrApi
|
||||
continue;
|
||||
}
|
||||
// Process the status separately because it must be updated using
|
||||
// the validate() and resiliate() methods of the class Adherent.
|
||||
// the validate(), resiliate() and exclude() methods of the class Adherent.
|
||||
if ($field == 'statut') {
|
||||
if ($value == '0') {
|
||||
$result = $member->resiliate(DolibarrApiAccess::$user);
|
||||
@ -341,6 +341,11 @@ class Members extends DolibarrApi
|
||||
if ($result < 0) {
|
||||
throw new RestException(500, 'Error when validating member: '.$member->error);
|
||||
}
|
||||
} elseif ($value == '-2') {
|
||||
$result = $member->exclude(DolibarrApiAccess::$user);
|
||||
if ($result < 0) {
|
||||
throw new RestException(500, 'Error when excluding member: '.$member->error);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$member->$field = $value;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user