fix(bio-links): check all PUT responses on save, toast on upload errors, and wire slug validation in BioLinkStudio
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 84/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- nextjs, react, typescript
- Área
- frontend
Línea de trabajo
Empieza en apps/web/components/bio-links/BioLinkStudio.tsx y sigue handleSave, handleUploadImage y las props de ProfileSettingsCard; comprueba en ProfileSettingsCard.tsx el callback de validación del slug. Verifica que se comprueben todas las respuestas de guardado, que los errores de carga muestren un toast de error y que los slugs no válidos impidan guardar. El trabajo está terminado cuando funcionan los tres comportamientos y los guardados fallidos nunca muestran un toast de éxito.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem Description
In apps/web/components/bio-links/BioLinkStudio.tsx, there are three error-handling and validation gaps:
-
False success toast on partial save failure (
handleSave):
handleSavesends 5 sequentialPUTrequests (/api/bio-links/settings,buttons,links,products,faqs), but only checksif (!settingsRes.ok).
The 4 subsequentPUTcalls (buttons,links,products,faqs) never checkres.ok, so if any of them fail,handleSavestill setsisSaved(true)and showstoast.success('Bio link updated', 'All changes published successfully'). -
Silent image upload failures (
handleUploadImage):
handleUploadImagecatches upload errors from/api/bio-links/upload, logs to the console, and returnsnullwithout callingtoast.error(...). Child callers (ProfileSettingsCard.tsx,CustomLinksManager.tsx,ProductsManager.tsx) do not display an error toast whennullis returned either. -
Slug validation never wired to
<ProfileSettingsCard>:
BioLinkStudio.tsxdeclaresconst [isSlugValid, setIsSlugValid] = useState(true)and checksif (!isSlugValid)inhandleSave, andProfileSettingsCard.tsxalready acceptsonSlugValidationChange?: (isValid: boolean) => void. However,onSlugValidationChange={setIsSlugValid}is never passed to<ProfileSettingsCard>, leavingisSlugValidpermanentlytrue.
Expected Behavior
handleSavechecksres.okon allPUTrequests (settings,buttons,links,products,faqs) and throws/toasts an error if any request fails, without showingtoast.success(...).handleUploadImagesurfaces a cleartoast.error(...)message whenever image upload fails.<ProfileSettingsCard>receivesonSlugValidationChange={setIsSlugValid}so invalid, taken, or reserved handles block saving as intended.
Where to Look
apps/web/components/bio-links/BioLinkStudio.tsx(handleUploadImage,handleSave,<ProfileSettingsCard>usage)apps/web/components/bio-links/ProfileSettingsCard.tsx(onSlugValidationChange)
Solution / Implementation Guide
- In
BioLinkStudio.tsx(handleSave):- Extract a small response-checking helper (e.g.
assertOk(res, fallbackMsg)) and apply it to thebuttons,links,products, andfaqsPUTresponses just likesettingsRes.
- Extract a small response-checking helper (e.g.
- In
BioLinkStudio.tsx(handleUploadImage):- In the
catchblock (or on!res.ok), calltoast.error(...)with a user-facing message before returningnull.
- In the
- In
BioLinkStudio.tsx(<ProfileSettingsCard>):- Pass
onSlugValidationChange={setIsSlugValid}to<ProfileSettingsCard />.
- Pass
- Lenguaje dominante
- TypeScript
- Estrellas
- 2
- Forks
- 1
- Merge medio
- 6 min
- PR fusionados (30 d)
- 27
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de sumamakhan761/tryinstance
-
backend good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
sumamakhan761/tryinstance#65 ·
Los mantenedores suelen responder en 1 día
-
backend good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
sumamakhan761/tryinstance#64 ·
Los mantenedores suelen responder en 1 día
-
backend good first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
sumamakhan761/tryinstance#63 ·
Los mantenedores suelen responder en 1 día
-
backend good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
sumamakhan761/tryinstance#62 ·
Los mantenedores suelen responder en 1 día
-
backend good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
sumamakhan761/tryinstance#60 ·
Los mantenedores suelen responder en 1 día
Todos los issues de sumamakhan761/tryinstance
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
makecindy/cindy#15342 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
kwitsch/claude-code-plugin-tooling#219 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
no-repo-link tool-submission
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
BraveOPotato/NoSignups#2618 ·
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100