getWards method
Retrieves a list of wards for a specific hospital, optionally filtered by block and floor.
hospitalId
The ID of the hospital.
block
Optional. The ID of the block to filter wards by.
floor
Optional. The floor number to filter wards by.
Returns a Future<List<dynamic>>
containing a list of ward data.
Implementation
Future<List<dynamic>> getWards(int hospitalId,
{int? block, int? floor}) async {
final endpoint =
'/api/hospitals/$hospitalId/wards/${block != null && floor != null ? '?block=$block&floor=$floor' : ''}';
return await _makeListRequest(endpoint);
}