Auto complete in post as well

This commit is contained in:
2025-10-12 19:49:16 +08:00
parent 6124dbfd79
commit e2d315afd4
3 changed files with 178 additions and 17 deletions

View File

@@ -25,4 +25,16 @@ class AutocompleteService {
final data = response.data as List<dynamic>;
return data.map((json) => AutocompleteSuggestion.fromJson(json)).toList();
}
Future<List<AutocompleteSuggestion>> getGeneralSuggestions(
String content,
) async {
final response = await _client.post(
'/sphere/autocomplete',
data: {'content': content},
);
final data = response.data as List<dynamic>;
return data.map((json) => AutocompleteSuggestion.fromJson(json)).toList();
}
}