feat: search product and fix product
This commit is contained in:
@@ -17,6 +17,7 @@ class ProductRemoteDatasource {
|
||||
int page = 1,
|
||||
int limit = Variables.defaultLimit,
|
||||
String? categoryId,
|
||||
String? search,
|
||||
}) async {
|
||||
try {
|
||||
final authData = await AuthLocalDataSource().getAuthData();
|
||||
@@ -31,6 +32,10 @@ class ProductRemoteDatasource {
|
||||
queryParameters['category_id'] = categoryId;
|
||||
}
|
||||
|
||||
if (search != null && search.isNotEmpty) {
|
||||
queryParameters['search'] = search;
|
||||
}
|
||||
|
||||
final response = await dio.get(
|
||||
url,
|
||||
queryParameters: queryParameters,
|
||||
|
||||
Reference in New Issue
Block a user