Skip to content

Commit

Permalink
throw RestException(500) if update of invoice fails #32134
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Bendtsen committed Dec 1, 2024
1 parent 888e8d7 commit 0e1744a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion htdocs/compta/facture/class/api_invoices.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,10 @@ public function put($id, $request_data = null)
}
}

if ($this->invoice->update(DolibarrApiAccess::$user)) {
if ($this->invoice->update(DolibarrApiAccess::$user) > 0) {
return $this->get($id);
} else {
throw new RestException(500, $this->invoice->error);
}

return false;
Expand Down

0 comments on commit 0e1744a

Please sign in to comment.