diff --git a/lib/client/v1/main.dart b/lib/client/v1/main.dart index cb500fd..dd1c46e 100644 --- a/lib/client/v1/main.dart +++ b/lib/client/v1/main.dart @@ -1,7 +1,7 @@ import 'package:flutter/foundation.dart' show required; -import 'package:lemmur/client/models/search.dart'; import '../models/category.dart'; +import '../models/search.dart'; export 'comment_endpoint.dart'; export 'post_endpoint.dart'; @@ -24,7 +24,7 @@ class V1 { @required String q, @required SearchType type, String communityId, - @required String sort, + @required SortType sort, int page, int limit, String auth, diff --git a/lib/client/v1/post_endpoint.dart b/lib/client/v1/post_endpoint.dart index 717caf9..5106562 100644 --- a/lib/client/v1/post_endpoint.dart +++ b/lib/client/v1/post_endpoint.dart @@ -32,8 +32,8 @@ extension PostEndpoint on V1 { /// GET /post/list /// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#get-posts Future> getPosts({ - @required String type, - @required String sort, + @required PostListingType type, + @required SortType sort, int page, int limit, int communityId, @@ -46,8 +46,8 @@ extension PostEndpoint on V1 { instanceUrl, "/api/v1/post/list", { - 'type_': type, - 'sort': sort, + 'type_': type.value, + 'sort': sort.value, if (page != null) 'page': page.toString(), if (limit != null) 'limit': limit.toString(), if (communityId != null) 'community_id': communityId.toString(), diff --git a/lib/client/v1/user_endpoint.dart b/lib/client/v1/user_endpoint.dart index e06e200..664e9fc 100644 --- a/lib/client/v1/user_endpoint.dart +++ b/lib/client/v1/user_endpoint.dart @@ -2,8 +2,8 @@ import 'package:flutter/foundation.dart' show required; import 'package:lemmur/client/models/captcha.dart'; import 'package:lemmur/client/models/comment.dart'; import 'package:lemmur/client/models/user.dart'; -import '../models/private_message.dart'; +import '../models/private_message.dart'; import 'main.dart'; extension UserEndpoint on V1 { @@ -40,7 +40,7 @@ extension UserEndpoint on V1 { Future getUserDetails({ int userId, String username, - @required String sort, + @required SortType sort, int page, int limit, int communityId, @@ -56,8 +56,8 @@ extension UserEndpoint on V1 { Future saveUserSettings({ @required bool showNsfw, @required String theme, - @required int defaultSortType, - @required int defaultListingType, + @required SortType defaultSortType, + @required PostListingType defaultListingType, @required String auth, }) { throw UnimplementedError(); @@ -66,7 +66,7 @@ extension UserEndpoint on V1 { /// GET /user/replies /// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#get-replies--inbox Future> getReplies({ - @required String sort, + @required SortType sort, int page, int limit, @required bool unreadOnly,