findShaderIdsByUserId method

  1. @override
Future<FindShaderIdsResponse> findShaderIdsByUserId(
  1. String userId, {
  2. Set<String>? filters,
  3. Sort? sort,
  4. int? from,
  5. int? num,
})

Returns a filtered FindShaderIdsResponse with a list of shader ids. for the user userId

  • filters: A set of tag filters
  • sort: The sort order of the shaders
  • from: A 0 based index for results returned
  • num: The total number of results

Upon success a list of shader ids is provided as well as the overall number of records in total (not the number of shader ids in the list, the number of total results). The error is set to null

In case of error a ResponseError is set and no shader id list is provided

Implementation

@override
Future<FindShaderIdsResponse> findShaderIdsByUserId(String userId,
    {Set<String>? filters, Sort? sort, int? from, int? num}) {
  return catchSqlError<FindShaderIdsResponse>(
      store.shaderDao
          .findIds(
              userId: userId,
              filters: filters,
              sort: sort ?? Sort.popular,
              from: from,
              num: num = options.userShaderCount)
          .then((results) => FindShaderIdsResponse(ids: results.toList())),
      (sqle) => FindShaderIdsResponse(
          error: toResponseError(sqle, context: contextUser, target: userId)),
      options);
}