+signup +login
Some checks failed
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
Some checks failed
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_timezone/flutter_timezone.dart';
|
||||
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:pshared/provider/pfe/provider.dart';
|
||||
import 'package:pshared/api/requests/login_data.dart';
|
||||
import 'package:pshared/models/describable.dart';
|
||||
import 'package:pshared/provider/account.dart';
|
||||
import 'package:pshared/provider/locale.dart';
|
||||
|
||||
import 'package:pweb/app/router/pages.dart';
|
||||
import 'package:pweb/pages/signup/form/content.dart';
|
||||
@@ -31,7 +36,7 @@ class SignUpFormState extends State<SignUpForm> {
|
||||
VoidCallback onSignUp,
|
||||
void Function(Object e) onError,
|
||||
) async {
|
||||
final pfeProvider = Provider.of<PfeProvider>(context, listen: false);
|
||||
final provider = Provider.of<AccountProvider>(context, listen: false);
|
||||
|
||||
setState(() {
|
||||
_autoValidateMode = true;
|
||||
@@ -42,20 +47,34 @@ class SignUpFormState extends State<SignUpForm> {
|
||||
}
|
||||
|
||||
try {
|
||||
// final account = await pfeProvider.signUp(
|
||||
// companyName: controllers.companyName.text.trim(),
|
||||
// description: controllers.description.text.trim().isEmpty
|
||||
// ? null
|
||||
// : controllers.description.text.trim(),
|
||||
// firstName: controllers.firstName.text.trim(),
|
||||
// lastName: controllers.lastName.text.trim(),
|
||||
// email: controllers.email.text.trim(),
|
||||
// password: controllers.password.text,
|
||||
// );
|
||||
final orgDescription = controllers.description.text.trim();
|
||||
final locs = AppLocalizations.of(context)!;
|
||||
final locale = context.read<LocaleProvider>().locale;
|
||||
final timezone = await FlutterTimezone.getLocalTimezone(locale.toString());
|
||||
await provider.signup(
|
||||
account: AccountData.build(
|
||||
login: LoginData.build(
|
||||
login: controllers.email.text.trim(),
|
||||
password: controllers.password.text,
|
||||
locale: locale.toLanguageTag(),
|
||||
),
|
||||
name: controllers.password.text,
|
||||
lastName: controllers.lastName.text.trim(),
|
||||
),
|
||||
organization: newDescribable(
|
||||
name: controllers.companyName.text.trim(),
|
||||
description: orgDescription.isEmpty ? null : orgDescription,
|
||||
),
|
||||
timezone: timezone.identifier,
|
||||
ownerRole: newDescribable(
|
||||
name: locs.ownerRole,
|
||||
description: locs.ownerRoleDescription,
|
||||
),
|
||||
);
|
||||
onSignUp();
|
||||
return 'ok';
|
||||
} catch (e) {
|
||||
onError(pfeProvider.error ?? e);
|
||||
onError(provider.error ?? e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user