refactor and cleanup
This commit is contained in:
11
redux/thunks/database/addPoiThunk.js
Normal file
11
redux/thunks/database/addPoiThunk.js
Normal file
@@ -0,0 +1,11 @@
|
||||
// /redux/thunks/database/addPoiThunk.js
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { addPoiService } from "../../../services/database/addPoiService";
|
||||
|
||||
export const addPoiThunk = createAsyncThunk("poi/add", async (formData, thunkAPI) => {
|
||||
try {
|
||||
return await addPoiService(formData);
|
||||
} catch (error) {
|
||||
return thunkAPI.rejectWithValue(error.message);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user