Search with tag & category

This commit is contained in:
2024-07-07 14:22:53 +08:00
parent f7cc4420b3
commit 60d7df4496
6 changed files with 122 additions and 14 deletions

View File

@ -7,10 +7,13 @@ class PostProvider extends GetConnect {
httpClient.baseUrl = ServiceFinder.services['interactive'];
}
Future<Response> listFeed(int page, {int? realm}) async {
Future<Response> listFeed(int page,
{int? realm, String? tag, category}) async {
final queries = [
'take=${10}',
'offset=$page',
if (tag != null) 'tag=$tag',
if (category != null) 'category=$category',
if (realm != null) 'realmId=$realm',
];
final resp = await get('/api/feed?${queries.join('&')}');