getDepartmentList static method

Future<AuthResult> getDepartmentList(
  1. int page,
  2. int limit, [
  3. bool? withCustomData,
  4. String? sortBy,
  5. String? orderBy,
])

get department List

Implementation

static Future<AuthResult> getDepartmentList(int page, int limit,
    [bool? withCustomData, String? sortBy, String? orderBy]) async {
  String withCustomDataStr =
      withCustomData == null ? 'false' : withCustomData.toString();
  String sortByStr = sortBy ?? 'JoinDepartmentAt';
  String orderByStr = orderBy ?? 'Desc';

  final Result result = await get('/api/v3/get-my-department-list?page=' +
      page.toString() +
      '&limit=' +
      limit.toString() +
      '&withCustomData=' +
      withCustomDataStr +
      '&sortBy=' +
      sortByStr +
      '&orderBy=' +
      orderByStr);
  AuthResult authResult = AuthResult(result);
  return authResult;
}