(#16) fix put lesson api call

This commit is contained in:
Primakov Alexandr Alexandrovich 2024-04-02 16:27:22 +03:00
parent 2087666991
commit 3d7e7a1783
2 changed files with 2 additions and 2 deletions

View File

@ -81,7 +81,7 @@ export const api = createApi({
updateLesson: builder.mutation<BaseResponse<Lesson>, Partial<Lesson> & Pick<Lesson, '_id'>>({
query: (data) => ({
method: 'PUT',
url: `/lesson/${data._id}`,
url: '/lesson',
body: data,
}),
invalidatesTags: ['LessonList'],

View File

@ -49,7 +49,7 @@ router.delete('/lesson/:lessonId', (req, res) => {
res.send({ success: true, body: { ok: true }})
})
router.put('/lesson/:lessonId', (req, res) => {
router.put('/lesson', (req, res) => {
res.send({ success: true, body: req.body })
})