getBoardsTemplate method

Future<Result<List<BoardDto>, DioException>> getBoardsTemplate(
  1. String organizationId
)

Implementation

Future<Result<List<BoardDto>,DioException>> getBoardsTemplate(
    String organizationId
    ) async {
  try{
    final result = await _dio.get<List<Map<String, dynamic>>>("${url}boards/templates/gallery");

    if(result.data == null){
      return Failure(DioException(requestOptions: result.requestOptions));
    }

    final boards = result.data!.map<BoardDto>((json) => BoardDto.fromJson(json)).toList();
    return Success(boards);
  } on DioException catch(e){
    return Failure(e);
  }
}