fix: form data empty error

pull/3813/head
Arik Chakma 2 years ago
parent 448c5cda5f
commit 6bf02c5687
  1. 8
      src/components/Login/AccountDropdown.astro
  2. 9
      src/components/Navigation.astro
  3. 3
      src/components/Setting/ChangePasswordForm.tsx
  4. 6
      src/components/Setting/UpdateProfileForm.tsx

@ -19,6 +19,14 @@
Your Profile
</a>
</li>
<li class='px-1'>
<a
href='/settings/profile'
class='block rounded px-4 py-2 text-sm font-medium text-slate-100 hover:bg-slate-700'
>
Settings
</a>
</li>
<li class='px-1'>
<button
class='block w-full rounded px-4 py-2 text-left text-sm font-medium text-slate-100 hover:bg-slate-700'

@ -79,6 +79,12 @@ import AccountNavigation from './Login/AccountNavigation.astro';
>Profile</a
>
</li>
<li id='settings-mobile-nav' class='hidden'>
<a
href='/settings/profile'
class='text-xl hover:text-blue-300 md:text-lg'>Settings</a
>
</li>
<li id='logout-mobile-nav' class='hidden'>
<button class='text-xl text-red-300 hover:text-red-400 md:text-lg'
>Logout</button
@ -104,6 +110,7 @@ import AccountNavigation from './Login/AccountNavigation.astro';
const profileLink = document.getElementById('profile-mobile-nav');
const logoutButton = document.getElementById('logout-mobile-nav');
const registerLink = document.getElementById('register-mobile-nav');
const settingsLink = document.getElementById('settings-mobile-nav');
const token = Cookies.get(TOKEN_COOKIE_NAME);
@ -111,9 +118,11 @@ import AccountNavigation from './Login/AccountNavigation.astro';
profileLink?.classList.remove('hidden');
logoutButton?.classList.remove('hidden');
registerLink?.classList.add('hidden');
settingsLink?.classList.remove('hidden');
} else {
profileLink?.classList.add('hidden');
logoutButton?.classList.add('hidden');
settingsLink?.classList.add('hidden');
registerLink?.classList.remove('hidden');
}

@ -58,9 +58,6 @@ export default function ChangePasswordForm() {
});
};
console.log(currentPassword, newPassword, newPasswordConfirmation);
console.log(`${TOKEN_COOKIE_NAME}=${Cookies.get(TOKEN_COOKIE_NAME)}`);
return (
<form onSubmit={handleSubmit}>
<h2 className="text-3xl font-bold sm:text-4xl">Password</h2>

@ -28,9 +28,9 @@ export default function UpdateProfileForm() {
headers,
body: JSON.stringify({
name,
github,
linkedin,
website,
github: github === '' ? undefined : github,
linkedin: linkedin === '' ? undefined : linkedin,
website: website === '' ? undefined : website,
}),
})
.then(async (res) => {

Loading…
Cancel
Save