Anujcodecraft / Anujcodecraft/notes-online

### ✅ Uploading PYQ Fails – Missing `uploader` & `branch` not ObjectId**

オープン
#34 コメント 3 件 リアクション 0 件 担当者 1 名 @Karthik7259 が担当を希望しています GitHub で見る
bug good first issue NodeJS ReactJs
主要言語
JavaScript
スター
7
フォーク
7
PR マージ指標
30日以内にマージされた PR はありません

説明

## 🛠️ Uploading PYQ Fails – Missing `uploader` & `branch` not ObjectId

### 🐛 Description:
Uploading a PYQ fails due to two schema validation issues:
1. `branch` expects an `ObjectId`, but receives a string.
2. `uploader` field is missing in the payload.

---

### 💥 Error Response:

```json
{
"error": "Validation failed",
"details": {
"branch": {
"stringValue": "\"CSE\"",
"valueType": "string",
"kind": "ObjectId",
"value": "CSE",
"path": "branch",
"name": "CastError",
"message": "Cast to ObjectId failed for value \"CSE\" at path \"branch\""
},
"uploader": {
"name": "ValidatorError",
"message": "Path `uploader` is required.",
"properties": {
"message": "Path `uploader` is required.",
"type": "required",
"path": "uploader"
},
"kind": "required",
"path": "uploader"
}
}
}
✅ Expected Behavior:
PYQ should be uploaded successfully when valid data is provided.

❌ Actual Behavior:
Validation fails and returns 400 status.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。