JaqiKal / pixavibe-frontend

The Pixavibe is a social media website for sharing photos. Created as part of my full-stack portfolio project 5 for the Code Institute diploma in full stack software development.
0 stars 0 forks source link

[BUG] Hashtag selection and editing not working in post creation form #68

Open JaqiKal opened 3 weeks ago

JaqiKal commented 3 weeks ago

Describe the bug When a user add a post they can select and deselect hashtag(s). After submit/save of post the hashtag array is empty. In the backend this feature works, in frontend it does not. The response from API is empty.

To Reproduce Steps to reproduce the behavior: Add a post with all attributes, submit. Follow along in inspect tabs console and network.

Expected behavior User shall be able to add hasthag to post and also be able to change selectione when in edit mode of post.

Screenshots

Image

Image

Information added to TESTING and README documentation

The error indicate that the response data does not contain the expected 'hashtag_ids' field. Instead, the response contains an empty 'hashtags' array. This suggests that the hashtags are not being properly associated with the post. Troubleshooting activities have been undertaken, also by senior developers (tutor support) but solution has not been found yet.

The feature has a bug registered in the project's Kanban board and will be revisited in future improvements of the Pixavibe app.

To maintain a smooth user experience, the hashtag feature is retained in the codebase, but the multiselect form has been removed from the PostCreateForm and PostEditForm.

Terminal warning:

In Post.js, line 37: we've disabled the ES linting rule for the unused hashtags variable and added a comment indicating that hashtags is intentionally unused for now, referring to documentation for more information.

This practice is generally discouraged as it can lead to code that is harder to maintain and understand. However, in this particular case, the feature is rather isolated and testing indicates nothing else is disrupted in the codebase. We are fully aware that this needs to be resolved before we add more functionality.

Image