Add subcription feature 10

This commit is contained in:
Urtzi Alfaro
2026-01-16 23:52:26 +01:00
parent 3a7d57ef90
commit 4b65817b3e
9 changed files with 89 additions and 29 deletions

View File

@@ -546,7 +546,16 @@ const NewProfileSettingsPage: React.FC = () => {
setIsLoading(true);
try {
await updateProfileMutation.mutateAsync(profileData);
// Map the form fields to the expected API format
// The API expects 'full_name' instead of separate 'first_name' and 'last_name'
const profileUpdateData = {
full_name: `${profileData.first_name} ${profileData.last_name}`.trim(),
phone: profileData.phone,
language: profileData.language,
timezone: profileData.timezone
};
await updateProfileMutation.mutateAsync(profileUpdateData);
setIsEditing(false);
showToast.success(t('profile.save_changes'));

View File

@@ -169,12 +169,21 @@ const ProfilePage: React.FC = () => {
const handleSaveProfile = async () => {
if (!validateProfile()) return;
setIsLoading(true);
try {
await updateProfileMutation.mutateAsync(profileData);
// Map the form fields to the expected API format
// The API expects 'full_name' instead of separate 'first_name' and 'last_name'
const profileUpdateData = {
full_name: `${profileData.first_name} ${profileData.last_name}`.trim(),
phone: profileData.phone,
language: profileData.language,
timezone: profileData.timezone
};
await updateProfileMutation.mutateAsync(profileUpdateData);
setIsEditing(false);
showToast.success('Perfil actualizado correctamente');
} catch (error) {