Add more `assert`s for checking required props

This commit is contained in:
krawieck 2020-08-12 11:55:26 +02:00
parent 1307b5e5b1
commit b433bf0971
2 changed files with 34 additions and 1 deletions

View File

@ -13,6 +13,10 @@ extension CommentEndpoint on V1 {
int formId,
@required String auth,
}) {
assert(content != null);
assert(postId != null);
assert(auth != null);
throw UnimplementedError();
}
@ -24,6 +28,10 @@ extension CommentEndpoint on V1 {
String formId,
@required String auth,
}) {
assert(content != null);
assert(editId != null);
assert(auth != null);
throw UnimplementedError();
}
@ -35,6 +43,10 @@ extension CommentEndpoint on V1 {
@required bool deleted,
@required String auth,
}) {
assert(editId != null);
assert(deleted != null);
assert(auth != null);
throw UnimplementedError();
}
@ -47,6 +59,10 @@ extension CommentEndpoint on V1 {
String reason,
@required String auth,
}) {
assert(editId != null);
assert(removed != null);
assert(auth != null);
throw UnimplementedError();
}
@ -57,6 +73,10 @@ extension CommentEndpoint on V1 {
@required bool read,
@required String auth,
}) {
assert(editId != null);
assert(read != null);
assert(auth != null);
throw UnimplementedError();
}
@ -67,6 +87,10 @@ extension CommentEndpoint on V1 {
@required bool save,
@required String auth,
}) {
assert(commentId != null);
assert(save != null);
assert(auth != null);
throw UnimplementedError();
}
@ -77,6 +101,10 @@ extension CommentEndpoint on V1 {
@required Vote score,
@required String auth,
}) {
assert(commentId != null);
assert(score != null);
assert(auth != null);
throw UnimplementedError();
}
}

View File

@ -20,7 +20,7 @@ class V1 {
/// POST /search
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#search
Search search({
Future<Search> search({
@required String q,
@required SearchType type,
String communityId,
@ -29,6 +29,10 @@ class V1 {
int limit,
String auth,
}) {
assert(q != null);
assert(type != null);
assert(sort != null);
throw UnimplementedError();
}
}
@ -76,6 +80,7 @@ extension PostTypeValue on PostListingType {
enum SortType {
active,
hot,
// ignore: constant_identifier_names
new_,
topDay,
topWeek,