fix(web): remove non-functional phone field; localize member-since date
The profile phone input was dead UI — there is no phone column in the
schema, PATCH /users/me only accepts { name, image }, and it was never
loaded, so saving the profile sent an empty phone that the API silently
dropped. Remove the field and stop sending phone. Real phone capture
needs a backend migration (follow-up).
Also fix the "member since" date hard-coding tr-TR; it now follows the
active locale like the changelog already does.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -42,12 +42,11 @@ export function SettingsContent({
|
||||
tab: string;
|
||||
onTabChange: (next: string) => void;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const { t, locale } = useTranslation();
|
||||
const { user, signOut } = useAuth();
|
||||
|
||||
// Profile state
|
||||
const [name, setName] = useState(user?.name || "");
|
||||
const [phone, setPhone] = useState("");
|
||||
const [savingProfile, setSavingProfile] = useState(false);
|
||||
|
||||
// Security state
|
||||
@@ -83,7 +82,7 @@ export function SettingsContent({
|
||||
e.preventDefault();
|
||||
setSavingProfile(true);
|
||||
try {
|
||||
await api.patch("/users/me", { name, phone });
|
||||
await api.patch("/users/me", { name });
|
||||
toast.success(t("settings.profile.updated"));
|
||||
} catch {
|
||||
toast.error(t("settings.profile.updateFailed"));
|
||||
@@ -212,25 +211,14 @@ export function SettingsContent({
|
||||
<Label>{t("settings.profile.email")}</Label>
|
||||
<Input value={user?.email || ""} disabled />
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="phone">{t("settings.profile.phone")}</Label>
|
||||
<Input
|
||||
id="phone"
|
||||
type="tel"
|
||||
placeholder={t("settings.profile.phonePlaceholder")}
|
||||
value={phone}
|
||||
onChange={(e) => setPhone(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
{user?.createdAt && (
|
||||
<div className="space-y-2">
|
||||
<Label>{t("settings.profile.memberSince")}</Label>
|
||||
<Input
|
||||
value={new Date(user.createdAt).toLocaleDateString("tr-TR", {
|
||||
day: "numeric",
|
||||
month: "long",
|
||||
year: "numeric",
|
||||
})}
|
||||
value={new Date(user.createdAt).toLocaleDateString(
|
||||
locale === "tr" ? "tr-TR" : "en-US",
|
||||
{ day: "numeric", month: "long", year: "numeric" },
|
||||
)}
|
||||
disabled
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user