add logs
This commit is contained in:
@@ -170,6 +170,8 @@ export async function registration(
|
||||
|
||||
const validatedFields = SignupFormSchema.safeParse(dataToValidate);
|
||||
|
||||
console.log(`try to register ${accountType}`);
|
||||
|
||||
if (!validatedFields.success) {
|
||||
const errors: Record<string, string> = {}
|
||||
JSON.parse(validatedFields.error.message).forEach((obj: {
|
||||
@@ -227,6 +229,7 @@ export async function registration(
|
||||
};
|
||||
|
||||
if (parsed.message_desc === 'Operation successful') {
|
||||
console.log(`registration - ${accountType}`);
|
||||
await createSession(parsed.message_body.token, email as string);
|
||||
} else {
|
||||
throw parsed;
|
||||
|
||||
@@ -203,11 +203,11 @@ export default function RegisterForm() {
|
||||
{t('company')}
|
||||
</button>
|
||||
<input
|
||||
type="hiden"
|
||||
type="hidden"
|
||||
id="accountType"
|
||||
name="accountType"
|
||||
className={`${styles['form-input-hidden']}`}
|
||||
defaultValue={accountType}
|
||||
value={accountType}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -25,8 +25,6 @@ export default function PersonalDataSettings() {
|
||||
}
|
||||
});
|
||||
|
||||
const [selectedValue, setSelectedValue] = useState('male');
|
||||
|
||||
const t = useTranslations('Global');
|
||||
|
||||
return (
|
||||
@@ -44,10 +42,10 @@ export default function PersonalDataSettings() {
|
||||
type="text"
|
||||
name="full_name"
|
||||
className="form-input"
|
||||
defaultValue={userData.fullName}
|
||||
defaultValue={userData?.fullName}
|
||||
/>
|
||||
</div>
|
||||
{userData.company && (
|
||||
{userData?.company && (
|
||||
<div className="form-group">
|
||||
<label className="form-label">
|
||||
{t('company')}:
|
||||
@@ -56,7 +54,7 @@ export default function PersonalDataSettings() {
|
||||
type="text"
|
||||
name="company"
|
||||
className="form-input"
|
||||
defaultValue={userData.company}
|
||||
defaultValue={userData?.company}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -68,7 +66,7 @@ export default function PersonalDataSettings() {
|
||||
type="text"
|
||||
name="email"
|
||||
className="form-input"
|
||||
defaultValue={userData.email}
|
||||
defaultValue={userData?.email}
|
||||
disabled={true}
|
||||
/>
|
||||
<small>
|
||||
@@ -83,7 +81,7 @@ export default function PersonalDataSettings() {
|
||||
type="phone"
|
||||
name="phone"
|
||||
className="form-input"
|
||||
defaultValue={userData.phone}
|
||||
defaultValue={userData?.phone}
|
||||
/>
|
||||
</div>
|
||||
<button type="submit" className="btn btn-primary">
|
||||
|
||||
Reference in New Issue
Block a user