implement a bunch of enums

This commit is contained in:
krawieck 2020-08-11 19:29:56 +02:00
parent 5971a947d6
commit 771a5f28ff
3 changed files with 11 additions and 11 deletions

View File

@ -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,

View File

@ -32,8 +32,8 @@ extension PostEndpoint on V1 {
/// GET /post/list
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#get-posts
Future<List<PostView>> 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(),

View File

@ -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<UserDetails> 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<String> 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<List<ReplyView>> getReplies({
@required String sort,
@required SortType sort,
int page,
int limit,
@required bool unreadOnly,