mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-24 19:57:55 +00:00
PR requests
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:syncrow_app/features/auth/model/login_with_email_model.dart';
|
||||
import 'package:syncrow_app/features/auth/model/signup_model.dart';
|
||||
import 'package:syncrow_app/features/auth/model/token.dart';
|
||||
@@ -85,9 +86,16 @@ class AuthenticationAPI {
|
||||
}
|
||||
|
||||
static Future<void> deleteAccount() async {
|
||||
await HTTPService().delete(
|
||||
path: ApiEndpoints.deleteProfile,
|
||||
expectedResponseModel: (p0) {},
|
||||
);
|
||||
try {
|
||||
await HTTPService().delete(
|
||||
path: ApiEndpoints.deleteProfile,
|
||||
expectedResponseModel: (p0) {},
|
||||
);
|
||||
} on DioException catch (e) {
|
||||
final errorData = e.response!.data;
|
||||
String errorMessage =
|
||||
errorData['error']['message'] ?? 'something went wrong';
|
||||
throw Exception(errorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user