Refactored axios util into a service
This commit is contained in:
1 parent
92877e20ec
commit
20e4c7ef07
14 files changed
+293
-289
No files matched your search
@@ -1,13 +1,13 @@
|
||||
import React, { useEffect } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import axiosInstance from "../Utils/NetworkService";
|
||||
import { networkService } from "../main";
|
||||
|
||||
const withAdminCheck = (WrappedComponent) => {
|
||||
const WithAdminCheck = (props) => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
axiosInstance
|
||||
networkService
|
||||
.doesAdminExist()
|
||||
.then((response) => {
|
||||
if (response.data.data === true) {
|
||||
|
||||
Reference in new issue
Block a user