push rasad front on new repo
This commit is contained in:
27
src/features/file/services/getFileProcess.js
Normal file
27
src/features/file/services/getFileProcess.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import axios from "axios";
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { getRoleFromUrl } from "../../../utils/getRoleFromUrl";
|
||||
import { LOADING_END, LOADING_START } from "../../../lib/redux/slices/appSlice";
|
||||
|
||||
export const getFileProcess = createAsyncThunk(
|
||||
"GET_FILE",
|
||||
async (id, { dispatch }) => {
|
||||
dispatch(LOADING_START());
|
||||
const { data, status } = await axios.get(`/Poultry_Request/${id}/`);
|
||||
dispatch(LOADING_END());
|
||||
|
||||
return { data, status };
|
||||
}
|
||||
);
|
||||
|
||||
export const getFileProcessOther = createAsyncThunk(
|
||||
"GET_FILE_OTHER",
|
||||
async (id, { dispatch }) => {
|
||||
dispatch(LOADING_START());
|
||||
const { data, status } = await axios.get(
|
||||
"process/?id=" + id + `&role=${getRoleFromUrl()}`
|
||||
);
|
||||
dispatch(LOADING_END());
|
||||
return { data, status };
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user