feat: suportar campo order no PUT de cursos do backend
Build and Deploy (Gitea) / build-and-deploy (push) Successful in 24s
Details
Build and Deploy (Gitea) / build-and-deploy (push) Successful in 24s
Details
This commit is contained in:
parent
71f0d15022
commit
54d1646cba
|
|
@ -1581,7 +1581,7 @@ app.post('/api/admin/courses', authenticateToken, requireAdmin, async (req: Auth
|
|||
});
|
||||
|
||||
app.put('/api/admin/courses/:id', authenticateToken, requireAdmin, async (req: AuthenticatedRequest, res: Response) => {
|
||||
const { title, description, thumbnail, category, isLocked, price, certificateMode } = req.body;
|
||||
const { title, description, thumbnail, category, isLocked, price, certificateMode, order } = req.body;
|
||||
const courseId = req.params.id;
|
||||
|
||||
try {
|
||||
|
|
@ -1595,6 +1595,7 @@ app.put('/api/admin/courses/:id', authenticateToken, requireAdmin, async (req: A
|
|||
...(isLocked !== undefined && { isLocked: isLocked === true || isLocked === 'true' }),
|
||||
...(price !== undefined && { price: Number(price) }),
|
||||
...(certificateMode && { certificateMode }),
|
||||
...(order !== undefined && { order: Number(order) }),
|
||||
}
|
||||
});
|
||||
res.json(course);
|
||||
|
|
|
|||
Loading…
Reference in New Issue