Project

General

Profile

Actions

Bug #94

open

Invalid type value in /api/event/like causes like button to disappear (Web-api)

Added by Vivek Kumar about 3 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Start date:
04/21/2026
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

The API accepts invalid values for the type field in the request body. When an invalid value (e.g., "InvalidValue") is sent, the request is still processed instead of being rejected. This results in inconsistent frontend behavior where the like button disappears from the post.

Steps to Reproduce:

  1. Send a POST request to /api/event/like
  2. Use a valid _id but an invalid type value:
{
  "_id": "69e76a97ec95b608604e97f9",
  "type": "InvalidValue"
}
  1. Observe the frontend after the request

Expected Behavior:
API should validate the type field
Invalid values should return an error (e.g., 400 Bad Request)
UI should remain unaffected by invalid input

Actual Behavior:
API accepts invalid type
Like state becomes inconsistent
Like button disappears from the post in UI


Files

Screenshot (484).png (783 KB) Screenshot (484).png Vivek Kumar, 04/21/2026 12:31 PM
Actions

Also available in: Atom PDF