File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 11// src/components/Wishlist.tsx
22import { useMutation , useQuery } from "@apollo/client" ;
3- import { useState } from "react" ;
3+ import { useId , useState } from "react" ;
44import {
55 ADD_GIFT ,
66 DELETE_GIFT ,
@@ -31,6 +31,8 @@ export default function Wishlist() {
3131
3232 const [ updateGift , { loading : updating } ] = useMutation ( UPDATE_GIFT ) ;
3333
34+ const nameId = useId ( ) ;
35+
3436 // hooks
3537 const addModal = useToggle ( false ) ;
3638 const editModal = useToggle ( false ) ;
@@ -214,11 +216,11 @@ export default function Wishlist() {
214216 < h2 className = "text-xl font-bold text-dark mb-4" > Ajouter une nouvelle idée</ h2 >
215217 < form onSubmit = { handleSubmit } className = "space-y-3" >
216218 < div >
217- < label htmlFor = "name" className = "block text-dark mb-1" >
219+ < label htmlFor = { nameId } className = "block text-dark mb-1" >
218220 Nom
219221 </ label >
220222 < input
221- id = "name"
223+ id = { nameId }
222224 type = "text"
223225 name = "name"
224226 value = { formData . name }
Original file line number Diff line number Diff line change @@ -170,6 +170,6 @@ describe("Wishlist", () => {
170170 expect ( callArg . refetchQueries ?. length ) . toBe ( 1 ) ;
171171 } ) ;
172172
173- // todo : add test for editing a gift idea
173+ // todo : add test for editing, deleting a gift idea
174174
175175} ) ;
You can’t perform that action at this time.
0 commit comments