Set holiday status to approved before approval

This commit is contained in:
Charlène Benke 2025-12-10 17:33:10 +01:00 committed by GitHub
parent da6dfebc70
commit 34f78f581b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -412,6 +412,7 @@ class Holidays extends DolibarrApi
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$this->holiday->status = Holiday::STATUS_APPROVED;
$result = $this->holiday->approve(DolibarrApiAccess::$user, $notrigger);
if ($result == 0) {
throw new RestException(304, 'Error nothing done. May be object is already approved');