Anujcodecraft/notes-online

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

开放

#33 创建于 2025年7月5日

 (0 条评论) (0 个反应) (0 位负责人)JavaScript (7 个派生)auto 404
NodeJSReactJsbuggood first issue

仓库指标

星标
 (7 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

🐛 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\""
}

贡献者指南