[Thien] Create PostgrestResponse class and PostgrestError class 馃コ #7
Conversation
lib/models/postgrest_response.dart
Outdated
PostgrestResponse copyWith({ | ||
dynamic body, | ||
int status, | ||
int statusCode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this variable is unused. We should remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah sure ^^
lib/models/postgrest_response.dart
Outdated
@@ -0,0 +1,57 @@ | |||
// To parse this JSON data, do | |||
// | |||
// final postgrestResponse = postgrestResponseFromJson(jsonString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this method postgrestResponseFromJson
?
It will be good to use dartdoc syntax ///
and provide a description for this class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add it and use dartdoc syntax too
lib/models/postgrest_error.dart
Outdated
@@ -0,0 +1,51 @@ | |||
// To parse this JSON data, do | |||
// | |||
// final postgrestError = postgrestErrorFromJson(jsonString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use dartdoc syntax /// to provide a description for this class.
where is postgrestErrorFromJson
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add it and use dartdoc syntax too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments; minor ones. But in general i'm happy the with your code, Nice work @duythien0912
@phamhieu I just
|
fix: wrong Request body field content-type
I just fixed the "stored procedure" test case already ^^ |
What kind of change does this PR introduce?
This PR to create a feature request in #4
It has 2 new class in the folder:
And change code on lib, example, test to have a response with custom class PostgrestResponse.
Have been move statusCode to PostgrestError.code
What is the current behavior?
#4
What is the new behavior?
Additional context
All tests passed on folder test
Not test example/main.dart yet