On the logic of giving likes and canceling likes

it is similar to giving likes on moments, but users may cancel likes at will, or even click non-stop. How should the function be handled so as to find a way of thinking

Mar.12,2021

I think we can set a Boolean value for each item, which can be combined with the back end (simple can)

    [
        {id:0,isfavorite:false}
    ]

should first inquire whether this person has given likes. If not, set + 1 to like. If you have already given likes, set-1, of course, according to the corresponding cooperation in the background

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3f25f-2bcb9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3f25f-2bcb9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?