Giter Club home page Giter Club logo

Comments (7)

cliveharber avatar cliveharber commented on July 27, 2024

From brief purely code read I can only identify the following:

The "hidden" field isn't actually hidden. In HTML hidden form fields have a type="hidden" rather than what you've put.
The "id" that you're logging out in onCommentVoteUpSubmit() doesn't exist in the given context, so will be undefined. What I think you wanted to log was this.newComment._id.

I hope this helps

from gettingmean-2.

walegbenga avatar walegbenga commented on July 27, 2024

What you said was what I did from the onset. i.e. this.newComment._id but it keeps returning error when compiled. It always complain that _id is not set in Comment class while it is set.

The problem is that am unable access any of the Comment field in the method

That is why I thought of doing it another way

P.s. am now able to get rid of the error, but still unable to pass the id from the form to the onCommentVoteUpSubmit()

from gettingmean-2.

cliveharber avatar cliveharber commented on July 27, 2024

from gettingmean-2.

walegbenga avatar walegbenga commented on July 27, 2024

why are you trying to set this data at the template level

From the onset, I thought the comment id is available in the component level but when I use this.comment._id, it returns

Undefined

I thought, it I could get it that way. I tried this.post.comments._id, it also returned

Undefined

That is why I chose the part of template component.

If this is actually a brand new comment (which I suspect)

This is not a brand new comment. USER A makes a comment, USER B, after reading the comment, click on the LIKE button to like the comment.

_I suspect that sending data with an already assigned id field will cause the original comment to be overwritten - maybe this is what you’re shooting for, maybe it isn’t.

No, that is not am aiming for.

Are you trying to add voting to comments that are already submitted and display in the page as a list?

Yes, that is my goal.

In which case, why are you using a newComment class to hold that data?

Reason why I did that is not far fetched, I simply wanted to use the newComment for creating (1) a new comment (2) updating an existing comment (3) using it in voting system.

This is what am trying to achieve.

Am sorry for incessant messages. That is due to a newbie trying to get to the professional level

from gettingmean-2.

cliveharber avatar cliveharber commented on July 27, 2024

from gettingmean-2.

walegbenga avatar walegbenga commented on July 27, 2024

I have message you.

Thanks so much

from gettingmean-2.

cliveharber avatar cliveharber commented on July 27, 2024

I've replied. I'm going to close this now.

from gettingmean-2.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.