Remove unnecessary param for fetching public key
This commit is contained in:
parent
92d154b96e
commit
3f5ef06a09
2 changed files with 3 additions and 9 deletions
|
@ -47,17 +47,11 @@ class UserService {
|
|||
});
|
||||
}
|
||||
|
||||
Future<String> getPublicKey({String email, int userID}) async {
|
||||
final queryParams = Map<String, dynamic>();
|
||||
if (userID != null) {
|
||||
queryParams["userID"] = userID;
|
||||
} else {
|
||||
queryParams["email"] = email;
|
||||
}
|
||||
Future<String> getPublicKey(String email) async {
|
||||
try {
|
||||
final response = await _dio.get(
|
||||
Configuration.instance.getHttpEndpoint() + "/users/public-key",
|
||||
queryParameters: queryParams,
|
||||
queryParameters: {"email": email},
|
||||
options: Options(
|
||||
headers: {
|
||||
"X-Auth-Token": Configuration.instance.getToken(),
|
||||
|
|
|
@ -152,7 +152,7 @@ class _SharingDialogState extends State<SharingDialog> {
|
|||
}
|
||||
final dialog = createProgressDialog(context, "Searching for user...");
|
||||
await dialog.show();
|
||||
final publicKey = await UserService.instance.getPublicKey(email: _email);
|
||||
final publicKey = await UserService.instance.getPublicKey(_email);
|
||||
await dialog.hide();
|
||||
if (publicKey == null) {
|
||||
Navigator.of(context).pop();
|
||||
|
|
Loading…
Add table
Reference in a new issue