-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
localStorage, fetch, axios, supabase
- Loading branch information
1 parent
9020f9c
commit 4aeb97a
Showing
20 changed files
with
791 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SUPABASE_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
@host = https://qxxivxowaxwsgeruydka.supabase.co | ||
@token = {{$dotenv SUPABASE_KEY}} | ||
@createdInvestmentId = {{createInvestment.response.body.$[0].id}} | ||
|
||
### Create a investment | ||
# @name createInvestment | ||
POST {{host}}/rest/v1/investments | ||
apikey: {{token}} | ||
Authorization: Bearer {{token}} | ||
Content-Type: application/json | ||
Prefer: return=representation | ||
|
||
{ | ||
"name": "Tesouro Selic 2029", | ||
"value": 10000 | ||
} | ||
|
||
### Read investments | ||
GET {{host}}/rest/v1/investments?select=* | ||
apikey: {{token}} | ||
Authorization: Bearer {{token}} | ||
|
||
### Read a investment | ||
GET {{host}}/rest/v1/investments?id=eq.{{createdInvestmentId}} | ||
apikey: {{token}} | ||
Authorization: Bearer {{token}} | ||
|
||
|
||
### Update a investment | ||
PATCH {{host}}/rest/v1/investments?id=eq.{{createdInvestmentId}} | ||
apikey: {{token}} | ||
Authorization: Bearer {{token}} | ||
Content-Type: application/json | ||
Prefer: return=representation | ||
|
||
{ | ||
"value": 15000 | ||
} | ||
|
||
### Delete a investment | ||
DELETE {{host}}/rest/v1/investments?id=eq.{{createdInvestmentId}} | ||
apikey: {{token}} | ||
Authorization: Bearer {{token}} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@startuml | ||
title DELETE | ||
hide footbox | ||
skinparam monochrome true | ||
|
||
Client -> Server: DELETE /rest/v1/investments?id=eq.1 | ||
note right: DELETE /rest/v1/investments?id=eq.1 HTTP/1.1\nHost: https://xyz.supabase.co\napikey: TOKEN\nAuthorization: Bearer TOKEN | ||
Server -> Client: HTTP/1.1 204 No Content | ||
note left: HTTP/1.1 204 No Content | ||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@startuml | ||
title GET | ||
hide footbox | ||
skinparam monochrome true | ||
|
||
Client -> Server: GET /rest/v1/investments?id=eq.1 | ||
note right: GET /rest/v1/investments?id=eq.1 HTTP/1.1\nHost: https://xyz.supabase.co\napikey: TOKEN\nAuthorization: Bearer TOKEN | ||
Server -> Client: HTTP/1.1 200 OK | ||
note left: HTTP/1.1 200 OK\n\n[\n {\n "id": 1,\n "name": "Tesouro Selic 2029",\n "name": "algorithms",\n "value": 10000,\n "created_at": "2023-09-08T01:58:13.676422+00:00"\n }\n] | ||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@startuml | ||
title GET | ||
hide footbox | ||
skinparam monochrome true | ||
|
||
Client -> Server: GET /rest/v1/investments?select=* | ||
note right: GET /rest/v1/investments?select=* HTTP/1.1\nHost: https://xyz.supabase.co\napikey: TOKEN\nAuthorization: Bearer TOKEN | ||
Server -> Client: HTTP/1.1 200 OK | ||
note left: HTTP/1.1 200 OK\n\n[\n {\n "id": 1,\n "name": "Tesouro Selic 2029",\n "name": "algorithms",\n "value": 10000,\n "created_at": "2023-09-08T01:58:13.676422+00:00"\n },\n ...\n] | ||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@startuml | ||
title PATCH | ||
hide footbox | ||
skinparam monochrome true | ||
|
||
Client -> Server: PATCH /rest/v1/investments?id=eq.1 | ||
note right: PATCH /rest/v1/investments?id=eq.1 HTTP/1.1\nHost: https://xyz.supabase.co\napikey: TOKEN\nAuthorization: Bearer TOKEN\nPrefer: return=representation\nContent-Type: application/json\n\n{\n "value": 15000\n} | ||
Server -> Client: HTTP/1.1 200 OK | ||
note left: HTTP/1.1 200 OK\n\n[\n {\n "id": 1,\n "name": "Tesouro Selic 2029",\n "name": "algorithms",\n "value": 15000,\n "created_at": "2023-09-08T01:58:13.676422+00:00"\n }\n] | ||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@startuml | ||
title POST | ||
hide footbox | ||
skinparam monochrome true | ||
|
||
Client -> Server: POST /rest/v1/investments | ||
note right: POST /rest/v1/investments HTTP/1.1\nHost: https://xyz.supabase.co\napikey: TOKEN\nAuthorization: Bearer TOKEN\nPrefer: return=representation\nContent-Type: application/json\n\n{\n "name": "Tesouro Selic 2029",\n "value": 10000\n} | ||
Server -> Client: HTTP/1.1 201 Created | ||
note left: HTTP/1.1 201 Created\n\n[\n {\n "id": 1,\n "name": "Tesouro Selic 2029",\n "name": "algorithms",\n "value": 10000,\n "created_at": "2023-09-08T01:58:13.676422+00:00"\n }\n] | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.