Anujcodecraft/notes-online

## ❌ Upvoting PYQ Fails – `branch` field casting error

Ouverte

#33 ouverte le 5 juil. 2025

 (0 commentaire) (0 réaction) (0 personne assignée)JavaScript (7 forks)auto 404
NodeJSReactJsbuggood first issue

Métriques du dépôt

Stars
 (7 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

🐛 Description:

When trying to upvote a PYQ, a 400 Bad Request error is returned from the backend. The response suggests a validation failure related to the branch field.


💥 Error (from network tab):

{
  "error": "Failed to upvote PYQ",
  "details": "pyqs validation failed: branch: Cast to ObjectId failed for value \"CSE\" (type string) at path \"branch\" because of \"BSONError\""
}

Guide contributeur