Factories are mixins that implement one Lomkit endpoint family. You mix in what you need per repository.
POST {baseRoute}/searchRestApiResponse<List<T>>class UsersRepository with SearchFactory<UserModel> {
@override
String get baseRoute => '/users';
@override
RestApiClient get httpClient => client;
@override
UserModel fromJson(Map<String, dynamic> json) => UserModel.fromJson(json);
@override
void onCatchError(RestApiResponse? r, Object e, StackTrace s) {}
}
GET {baseRoute}/{id} or POST {baseRoute}/details, etc.)RestApiResponse<T>Check your project’s DetailsFactory implementation for the exact signature and route used.
POST {baseRoute}/mutateRestApiResponse<LaravelRestApiMutateResponse>POST {baseRoute}/actions/{actionUriKey}RestApiResponse<int> where data is impactedDELETE {baseRoute}{ "resources": [ids...] }RestApiResponse<List<T>>