Update backend 2
All checks were successful
Deploy to Production / deploy (push) Successful in 19s

This commit is contained in:
silverpro89
2026-02-25 20:05:00 +07:00
parent 085f36078a
commit 47ab75f264
4 changed files with 47 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ class ContextController {
*/
async createContext(req, res, next) {
try {
const { title, desc, grade, type } = req.body;
const { title, desc, grade, type, type_image , reference_id } = req.body;
// Validate required fields
if (!title || !desc || !grade) {
@@ -35,9 +35,11 @@ class ContextController {
desc,
grade: gradeNum,
type: type || 'general',
type_image: type_image || null,
status: 0, // Draft
context: '',
knowledge: ''
knowledge: '',
reference_id: reference_id || null
});
res.status(201).json({