👽 Update API to microservices
♻️ Refactor router pushes
This commit is contained in:
@@ -28,14 +28,14 @@ part 'settings.g.dart';
|
||||
@riverpod
|
||||
Future<List<SnAuthFactor>> authFactors(Ref ref) async {
|
||||
final client = ref.read(apiClientProvider);
|
||||
final res = await client.get('/accounts/me/factors');
|
||||
final res = await client.get('/id/accounts/me/factors');
|
||||
return res.data.map<SnAuthFactor>((e) => SnAuthFactor.fromJson(e)).toList();
|
||||
}
|
||||
|
||||
@riverpod
|
||||
Future<List<SnContactMethod>> contactMethods(Ref ref) async {
|
||||
final client = ref.read(apiClientProvider);
|
||||
final resp = await client.get('/accounts/me/contacts');
|
||||
final resp = await client.get('/id/accounts/me/contacts');
|
||||
return resp.data
|
||||
.map<SnContactMethod>((e) => SnContactMethod.fromJson(e))
|
||||
.toList();
|
||||
@@ -44,7 +44,7 @@ Future<List<SnContactMethod>> contactMethods(Ref ref) async {
|
||||
@riverpod
|
||||
Future<List<SnAccountConnection>> accountConnections(Ref ref) async {
|
||||
final client = ref.read(apiClientProvider);
|
||||
final resp = await client.get('/accounts/me/connections');
|
||||
final resp = await client.get('/id/accounts/me/connections');
|
||||
return resp.data
|
||||
.map<SnAccountConnection>((e) => SnAccountConnection.fromJson(e))
|
||||
.toList();
|
||||
@@ -68,7 +68,7 @@ class AccountSettingsScreen extends HookConsumerWidget {
|
||||
try {
|
||||
showLoadingModal(context);
|
||||
final client = ref.read(apiClientProvider);
|
||||
await client.delete('/accounts/me');
|
||||
await client.delete('/id/accounts/me');
|
||||
if (context.mounted) {
|
||||
showSnackBar('accountDeletionSent'.tr());
|
||||
}
|
||||
|
Reference in New Issue
Block a user