Skip to content

Commit f5dfbda

Browse files
committed
Short List Delete working
Another solo achievement.
1 parent f52f5fb commit f5dfbda

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

resources/js/components/Shortlist.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,21 @@ export function Shortlist({
3737
<p className="px-3 text-sm text-slate-800">
3838
{puppy.name}
3939
</p>
40-
<DeleteButton
41-
id={puppy.id}
42-
/>
40+
<DeleteButton puppy={puppy} />
4341
</li>
4442
))}
4543
</ul>
4644
</div>
4745
);
4846
}
4947

50-
function DeleteButton({
51-
id,
52-
}: {
53-
id: Puppy['id'];
54-
}) {
48+
function DeleteButton({ puppy }: { puppy: Puppy }) {
5549
const [pending, setPending] = useState(false);
5650
return (
5751
<Link
52+
preserveScroll
5853
method={'patch'}
59-
// href={like(puppy.id)}
54+
href={like(puppy.id)}
6055
// onClick={async () => {
6156
// setPending(true);
6257
// const updatedPuppy = await toggleLikedStatus(id);

0 commit comments

Comments
 (0)