Skip to content
This repository has been archived by the owner on May 13, 2023. It is now read-only.

[Thien] Create PostgrestResponse class and PostgrestError class 馃コ #7

Merged
merged 5 commits into from Oct 4, 2020

Conversation

duythien0912
Copy link
Contributor

@duythien0912 duythien0912 commented Oct 3, 2020

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:

  • lib/models/postgrest_error.dart
  • lib/models/postgrest_response.dart

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?

image

Additional context

All tests passed on folder test
Not test example/main.dart yet

image

PostgrestResponse copyWith({
dynamic body,
int status,
int statusCode,
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah sure ^^

@@ -0,0 +1,57 @@
// To parse this JSON data, do
//
// final postgrestResponse = postgrestResponseFromJson(jsonString);
Copy link
Member

@phamhieu phamhieu Oct 3, 2020

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.

Copy link
Contributor Author

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

@@ -0,0 +1,51 @@
// To parse this JSON data, do
//
// final postgrestError = postgrestErrorFromJson(jsonString);
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

@phamhieu phamhieu left a 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 phamhieu mentioned this pull request Oct 3, 2020
@duythien0912
Copy link
Contributor Author

duythien0912 commented Oct 4, 2020

@phamhieu I just

  • Clean up code
  • Add function postgrestResponseFromJson, postgrestErrorFromJson
    馃檶

@duythien0912
Copy link
Contributor Author

I just fixed the "stored procedure" test case already ^^

@phamhieu phamhieu merged commit 47f7386 into supabase:master Oct 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants