[core] Rework Profile Edge Function (#34)

This commit introduces a new "profile-v2" edge function and deprecates
the "profile-v1" edge function. We decided to provide a new edge
function for all profile related operation to improve the handling of
the different operation the edge function is responsible for.

The main differences to the "profile-v1" functions are:
- Pass the operation id within the request url instead of the body of
  the request.
- Move the operations for accounts (e.g. GitHub) to seperate files, to
  improve the readability of the function.
- Do not require the "sourceType" anymore, instead we are using the
  operation id and request method to determine the operation which
  should be executed
- The request body is now only used for the data of the corresponding
  account and not for any other information like the operation id and
  source information.
This commit is contained in:
Rico Berger
2023-10-14 21:20:08 +02:00
committed by GitHub
parent 4c0a1fd5ad
commit 8e1e1c0eca
7 changed files with 292 additions and 21 deletions

View File

@@ -35,7 +35,7 @@ class SettingsAccountsGithub extends StatelessWidget {
await Provider.of<ProfileRepository>(
context,
listen: false,
).deleteGithubAccount();
).githubDeleteAccount();
} catch (_) {}
}
@@ -166,7 +166,7 @@ class _SettingsAccountsGithubAddState extends State<SettingsAccountsGithubAdd> {
await Provider.of<ProfileRepository>(
context,
listen: false,
).addGithubAccount(_tokenController.text);
).githubAddAccount(_tokenController.text);
setState(() {
_isLoading = false;