getById method
Future<TurboResponse<MODEL>>
getById(
{ - required String id,
- String? collectionPathOverride,
- bool tryCache = true,
- bool forceCacheRefresh = false,
})
Implementation
Future<TurboResponse<MODEL>> getById({
required String id,
String? collectionPathOverride,
bool tryCache = true,
bool forceCacheRefresh = false,
}) async {
final response = await api.getByIdWithConverter(
id: id,
collectionPathOverride: collectionPathOverride,
tryCache: tryCache,
forceCacheRefresh: forceCacheRefresh,
);
if (response.isSuccess) {
final model = upsertResult(dto: response.result!);
return TurboResponse.success(
result: model,
title: response.title,
message: response.message,
);
}
return const TurboResponse.failAsBool();
}