-
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.
- Loading branch information
Showing
23 changed files
with
30 additions
and
30 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,25 @@ | ||
import 'dart:convert'; | ||
import 'package:http/http.dart' as http; | ||
import '../swagger/swagger.dart'; | ||
|
||
Future<DatabaseSwagger?> fetchDatabaseSwagger( | ||
String url, String anonKey) async { | ||
final response = await http.get(Uri.parse('$url/rest/v1/?apikey=$anonKey')); | ||
String responseBody = ""; | ||
if (response.statusCode == 200) { | ||
return DatabaseSwagger.fromJson(jsonDecode(response.body)); | ||
} else { | ||
print("Error Fetching Supabase Swagger"); | ||
responseBody = response.body; | ||
} | ||
|
||
print("Trying without the api key..."); | ||
final response2 = await http.get(Uri.parse('$url/rest/v1/')); | ||
if (response2.statusCode == 200) { | ||
print("Fetched Supabase Swagger!"); | ||
return DatabaseSwagger.fromJson(jsonDecode(response.body)); | ||
} | ||
|
||
print(responseBody); | ||
return null; | ||
} |
File renamed without changes.
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
File renamed without changes.
Empty file.
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