fix likes
This commit is contained in:
parent
38064eff2b
commit
a8f111995f
@ -34,7 +34,12 @@ router.post('/toggle-like', (req, res) => {
|
||||
|
||||
if (charLikes[charId]) {
|
||||
const currentLikes = new Set(charLikes[charId].likes)
|
||||
|
||||
if (currentLikes.has(id)) {
|
||||
currentLikes.delete(id)
|
||||
} else {
|
||||
currentLikes.add(id)
|
||||
}
|
||||
|
||||
charLikes[charId].likes = [...currentLikes]
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user