diff --git a/src/redux/asyncThunks/modelCrudAsyncThunk.js b/src/redux/asyncThunks/modelCrudAsyncThunk.js index 4f38010..8bbfe7c 100644 --- a/src/redux/asyncThunks/modelCrudAsyncThunk.js +++ b/src/redux/asyncThunks/modelCrudAsyncThunk.js @@ -20,7 +20,7 @@ const fetchGetAllModels = createAsyncThunk( * param id: model id */ const fetchGetOneModelAndDownload = createAsyncThunk( - 'model/fetchGetAllModels', + 'model/fetchGetOneModelAndDownload', async ( body, thunkAPI @@ -40,7 +40,7 @@ const fetchGetOneModelAndDownload = createAsyncThunk( * param user_id: user id */ const fetchUploadModel = createAsyncThunk( - 'model/fetchGetAllModels', + 'model/fetchUploadModel', async ( body, thunkAPI diff --git a/src/redux/asyncThunks/renderCrudAsyncThunk.js b/src/redux/asyncThunks/renderCrudAsyncThunk.js index 13a6186..afe56f2 100644 --- a/src/redux/asyncThunks/renderCrudAsyncThunk.js +++ b/src/redux/asyncThunks/renderCrudAsyncThunk.js @@ -5,7 +5,7 @@ let endpoint = '/render/' const fetchGetAllRenders = createAsyncThunk( - 'model/fetchGetAllModels', + 'render/fetchGetAllRenders', async ( token, thunkAPI @@ -20,7 +20,7 @@ const fetchGetAllRenders = createAsyncThunk( * param id: render id */ const fetchGetOneRenderAndDownload = createAsyncThunk( - 'model/fetchGetAllModels', + 'render/fetchGetOneRenderAndDownload', async ( body, thunkAPI diff --git a/src/redux/asyncThunks/userAuthAsyncThunk.js b/src/redux/asyncThunks/userAuthAsyncThunk.js index 03557e8..9c8999c 100644 --- a/src/redux/asyncThunks/userAuthAsyncThunk.js +++ b/src/redux/asyncThunks/userAuthAsyncThunk.js @@ -9,7 +9,7 @@ let endpoint = '/user/auth' * param password: password string */ const fetchLogin = createAsyncThunk( - 'model/fetchGetAllModels', + 'user/auth/fetchLogin', async ( body, thunkAPI @@ -22,6 +22,25 @@ const fetchLogin = createAsyncThunk( } ) +/** + * @param body: + * param token: user token + */ +const fetchLogout = createAsyncThunk( + 'user/auth/fetchLogout', + async ( + token, + thunkAPI + ) => { + return await abstractService._delete( + endpoint, + '', + token + ) + } +) + export default { - fetchLogin + fetchLogin, + fetchLogout } \ No newline at end of file diff --git a/src/redux/asyncThunks/userCrudAsyncThunk.js b/src/redux/asyncThunks/userCrudAsyncThunk.js index 442d33c..8f04df1 100644 --- a/src/redux/asyncThunks/userCrudAsyncThunk.js +++ b/src/redux/asyncThunks/userCrudAsyncThunk.js @@ -1,11 +1,11 @@ import { createAsyncThunk } from '@reduxjs/toolkit' import abstractService from './abstractService' -let endpoint = '/model/' +let endpoint = '/user/' const fetchGetAllUsers = createAsyncThunk( - 'model/fetchGetAllModels', + 'user/fetchGetAllUsers', async ( token, thunkAPI @@ -24,7 +24,7 @@ const fetchGetAllUsers = createAsyncThunk( * param email: email string */ const fetchRegister = createAsyncThunk( - 'model/fetchGetAllModels', + 'user/fetchRegister', async ( body, thunkAPI