Skip to content

Commit

Permalink
Merge pull request #179 from flotonus/bugfix-API-GetAvailability
Browse files Browse the repository at this point in the history
BUGFIX - API: reflect qry param in GetAvailability
  • Loading branch information
effgarces authored Mar 29, 2023
2 parents 4fb9a16 + 4c8ce39 commit 15e2f78
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions WebServices/ResourcesWebService.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ public function GetTypes()
* @response ResourcesAvailabilityResponse
* @return void
*/
public function GetAvailability($resourceId = null)
public function GetAvailability()
{
$dateQueryString = $this->server->GetQueryString(WebServiceQueryStringKeys::DATE_TIME);
$resourceId = $this->server->GetQueryString(WebServiceQueryStringKeys::RESOURCE_ID);

if (!empty($dateQueryString)) {
$requestedTime = WebServiceDate::GetDate($dateQueryString, $this->server->GetSession());
Expand All @@ -144,7 +145,7 @@ public function GetAvailability($resourceId = null)
$resources[] = $this->resourceRepository->LoadById($resourceId);
}

$lastDateSearched = $requestedTime->AddDays(30);
$lastDateSearched = $requestedTime->AddDays(7);
$reservations = $this->GetReservations($this->reservationRepository->GetReservations($requestedTime, $lastDateSearched, null, null, null, $resourceId));

$resourceAvailability = [];
Expand Down

0 comments on commit 15e2f78

Please sign in to comment.