getInvites method

  1. @override
Future<List<PlanInvite>> getInvites(
  1. String token
)
override

Fetches all invites for the user associated with the given token.

Implementation

@override
Future<List<PlanInvite>> getInvites(String token) async {
  log('Getting invites');

  try {
    final response = await _apiService.callFunction(
      function: 'local_lbplanner_plan_get_invites',
      token: token,
      body: {},
    );

    response.assertList();

    final invites = response.asList.map(PlanInvite.fromJson).toList();

    log('Got ${invites.length} invites');

    return invites;
  } catch (e, s) {
    log('Failed to get invites', e, s);
    rethrow;
  }
}