completed migrating data scope from user to workspace
This commit is contained in:
@@ -61,17 +61,18 @@ class Http {
|
||||
/// Issues a POST request without authentication headers and returns
|
||||
/// the raw [Response] object.
|
||||
Future<Response> postRaw(String url, {dynamic data}) async {
|
||||
Map<String, String> headers = await getHeaders();
|
||||
final response = await dio.post(
|
||||
baseUrl + url,
|
||||
data: data,
|
||||
options: Options(headers: {'Content-Type': 'application/json'}),
|
||||
options: Options(headers: headers),
|
||||
);
|
||||
logger.i(response.data.toString());
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<dynamic> post(String url, dynamic data) async {
|
||||
Map<String, String> headers = {'Content-Type': 'application/json'};
|
||||
Map<String, String> headers = await getHeaders();
|
||||
|
||||
Response response;
|
||||
response = await dio.post(
|
||||
@@ -130,10 +131,7 @@ class Http {
|
||||
) async {
|
||||
final formData = FormData.fromMap({
|
||||
...fields,
|
||||
fileFieldName: MultipartFile.fromBytes(
|
||||
fileBytes,
|
||||
filename: fileName,
|
||||
),
|
||||
fileFieldName: MultipartFile.fromBytes(fileBytes, filename: fileName),
|
||||
});
|
||||
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
@@ -142,9 +140,7 @@ class Http {
|
||||
final response = await dio.post(
|
||||
baseUrl + url,
|
||||
data: formData,
|
||||
options: Options(headers: {
|
||||
'Authorization': 'Bearer $token',
|
||||
}),
|
||||
options: Options(headers: {'Authorization': 'Bearer $token'}),
|
||||
);
|
||||
logger.i(response.data.toString());
|
||||
return response.data;
|
||||
|
||||
Reference in New Issue
Block a user