Redux -> Fixes
parent
d2c3a9d272
commit
0131d75f8b
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(
|
|||
}
|
||||
)
|
||||
|
||||
export default {
|
||||
fetchLogin
|
||||
/**
|
||||
* @param body:
|
||||
* param token: user token
|
||||
*/
|
||||
const fetchLogout = createAsyncThunk(
|
||||
'user/auth/fetchLogout',
|
||||
async (
|
||||
token,
|
||||
thunkAPI
|
||||
) => {
|
||||
return await abstractService._delete(
|
||||
endpoint,
|
||||
'',
|
||||
token
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
export default {
|
||||
fetchLogin,
|
||||
fetchLogout
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue