Skip to content

Commit

Permalink
Only booking name in bookings fetch request
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Ryzhkov committed Oct 2, 2022
1 parent e480db7 commit 8eb61eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ A client side part of a web app for managing hotel bookings by organazing them i
- **React Router**: single page app routing.

## Changes
### v1.1.2
- Allow only booking name in bookings fetch request.
### v1.1.1
- Merged floors and rooms GET API method endpoints.
### v1.1.0
Expand Down
4 changes: 2 additions & 2 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ export async function fetchCityTaxAsync(from: string, to: string): Promise<{ dat
return fetchJsonDataAsync<CityTaxData>(`/api/v1/stats/city-tax?from=${from}&to=${to}`);
}

export async function fetchBookings(nameOrId: string, from: string, to: string): Promise<{ data: BookingShortData[] }> {
return fetchJsonDataAsync<BookingShortData[]>(`/api/v1/bookings?nameOrId=${nameOrId}&from=${from}&to=${to}`);
export async function fetchBookings(name: string, from: string, to: string): Promise<{ data: BookingShortData[] }> {
return fetchJsonDataAsync<BookingShortData[]>(`/api/v1/bookings?name=${name}&from=${from}&to=${to}`);
}

export async function fetchClients(query: string): Promise<{ data: ClientData[] }> {
Expand Down

0 comments on commit 8eb61eb

Please sign in to comment.