Redux -> Fixes

feature/0_redux_slices
TBS093A 2021-02-17 10:00:09 +01:00
parent d2c3a9d272
commit 0131d75f8b
4 changed files with 28 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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
}

View File

@ -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