Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend pinning method for pinning a post #12

Open
wants to merge 3 commits into
base: f24
Choose a base branch
from
Open

Conversation

tinchil
Copy link

@tinchil tinchil commented Oct 10, 2024

Added isPinned field to the Posts object and stored in database with the posts object. Also created a method for pinning a post to toggle the isPinned field to work towards an API call to toggle the isPinned field to call it through a frontend UI event.

I am still working on trying to test the implementation and making sure that the togglePinned method is actually working as intended and the pinning is stored across multiple sessions. If anyone has any tips/suggestions on how I could test it, or how to connect the frontend UI button to the backend method that would be much appreciated.

@emshyu
Copy link

emshyu commented Oct 10, 2024

Hi! I think it will be a good idea to run the lint tests first to help with general debugging. I am also running into difficulties with calling functions in .tpl files and after talking to a TA at OH, it seems to be a common issue in the class.

However, you might have luck looking at the files in the src/controllers directories or in public/src/client/topic/posts.js and searching for instances where they render templates.

@JorgeGraciaViveros
Copy link

Added isPinned field to the Posts object and stored in database with the posts object. Also created a method for pinning a post to toggle the isPinned field to work towards an API call to toggle the isPinned field to call it through a frontend UI event.

I am still working on trying to test the implementation and making sure that the togglePinned method is actually working as intended and the pinning is stored across multiple sessions. If anyone has any tips/suggestions on how I could test it, or how to connect the frontend UI button to the backend method that would be much appreciated.

That sounds like solid advice! In addition to checking the files in the src/controllers and public/src/client directories, you might want to look into using a API testing tool. It can help ensure that your API call to toggle the isPinned field is functioning correctly independently of the frontend UI. I created the UI for Pinned and so for connecting the frontend to the backend, I'd suggest verifying that the event listeners in your UI are correctly triggering the function calls and that the data is being passed correctly. Sometimes using console logs strategically within the function can help trace where things might be breaking down

@tinchil tinchil self-assigned this Oct 11, 2024
@tinchil tinchil added the enhancement New feature or request label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants