getUsersAssignedToDoc method

  1. @override
Future<RequestResponse<List<ToDo?>?>> getUsersAssignedToDoc({
  1. required String doctype,
  2. required String docName,
})
override

Returns the users assigned to a document of a certain doctype as list of ToDo.

Implementation

@override
Future<RequestResponse<List<ToDo?>?>> getUsersAssignedToDoc(
    {required String doctype, required String docName}) async {
  EmptyDoctypeError.verify(doctype);
  EmptyDocNameError.verify(docName);
  final response = await getList(ToDo(), filters: {
    'reference_type': doctype,
    'reference_name': docName
  }, fields: [
    'date',
    'status',
    'assigned_by',
    'assigned_by_full_name',
    'owner',
    'priority',
    'description'
  ]);

  if (response.isSuccess) {
    return response;
  } else {
    return RequestResponse.fail(
        handleError('get_users_assigned_to_doc', response.error));
  }
}