Giter Club home page Giter Club logo

Comments (3)

jessenieminen avatar jessenieminen commented on July 24, 2024

Hi,

I'm not sure what you're trying to really do here but just to clarify jquery-comments doesn't try to update the IDs of your models or validate them for conflicting IDs, nor should it do so.

That kind of things should always be handled in you backend and/or API for a number of reasons, mainly related to security and data integrity.

Your API is thus responsible for providing the updated IDs, not jquery-comments.

from jquery-comments.

RedPointMS avatar RedPointMS commented on July 24, 2024

@jessenieminen I think this issue shouldn't be closed. There is indeed a problem with creation of new comment after deletion. Here are the steps to reproduce:

  1. Delete an existing comment
  2. Without closing the window, add a new comment

The new comment is created with internal id (in commentJSON) of the existing last comment. So for example if I had ids: c1, c2, c3 and deleted c2, after adding new comment the new one has id c3. Thus this leads to duplication of c3. As far as I know jquery-comments doesn't expose any function to reindex the internal ids.
Ami I missing anything?

UPDATE:
Got it working by overwriting the commentJSON.id with my own unique id generator. I think that this should be explicitely stated in the documentation.

from jquery-comments.

MarksEliel avatar MarksEliel commented on July 24, 2024

Post exemple code please

from jquery-comments.

Related Issues (20)

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.