project_next_14_ai_prompt_sharing icon indicating copy to clipboard operation
project_next_14_ai_prompt_sharing copied to clipboard

Issue with "handleEdit" & "handleDelete"

Open HunnyHunnyail opened this issue 1 year ago • 1 comments

I'm currently at implementing the logic for the handleEdit function in the page.jsx of the MyProfile, but there is a bug occuring.

It is not being directed to update-prompt route after using the router.push() method, also I checked for all the silly mistakes but could not find any. Then I discovered that in the PromptCard component, where the Edit and Delete buttons are being rendered after the

{session?.user.id === post.creator._id && pathName === '/profile' && (

Edit

Delete

)}

I got to that the even without clicking the buttons I was still getting the console logs. And I think this is the issue but cannot seem to find a solution any help

HunnyHunnyail avatar Jul 11 '23 01:07 HunnyHunnyail

hi, when you click edit - does the page URL change? if so, please copy and paste the URL into here. i made a mistake in my profile/page.jsx where i used ' ' instead of ``

if handleedit isn't being called, then i'd suggest copying the Profile component and the profile page.jsx from github and seeing if that fixes your issue. If it does, then you know there is a typo, and you can compare.

Nerih avatar Jul 19 '23 17:07 Nerih