From 3d7e7a1783395c87e65b9ca8a402f4dcfcc60334 Mon Sep 17 00:00:00 2001 From: primakov Date: Tue, 2 Apr 2024 16:27:22 +0300 Subject: [PATCH] (#16) fix put lesson api call --- src/__data__/api/api.ts | 2 +- stubs/api/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/__data__/api/api.ts b/src/__data__/api/api.ts index 9a58848..997ab2f 100644 --- a/src/__data__/api/api.ts +++ b/src/__data__/api/api.ts @@ -81,7 +81,7 @@ export const api = createApi({ updateLesson: builder.mutation, Partial & Pick>({ query: (data) => ({ method: 'PUT', - url: `/lesson/${data._id}`, + url: '/lesson', body: data, }), invalidatesTags: ['LessonList'], diff --git a/stubs/api/index.js b/stubs/api/index.js index efe3fef..453cc33 100644 --- a/stubs/api/index.js +++ b/stubs/api/index.js @@ -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 }) })