Progress
This commit is contained in:
@@ -3,19 +3,19 @@ import Axios from "axios";
|
||||
import queryString from "query-string";
|
||||
import React, { useEffect } from "react";
|
||||
import { useCookies } from "react-cookie";
|
||||
import { useNavigate, useLocation } from "react-router-dom";
|
||||
import { useNavigate, useSearchParams } from "react-router-dom";
|
||||
import QboSignIn from "../../assets/qbo/C2QB_green_btn_med_default.svg";
|
||||
|
||||
export default function QboAuthorizeComponent() {
|
||||
const location = useLocation();
|
||||
const location = useSearchParams();
|
||||
const history = useNavigate();
|
||||
const [, setCookie] = useCookies(["access_token", "refresh_token"]);
|
||||
const [setCookie] = useCookies(["access_token", "refresh_token"]);
|
||||
|
||||
const handleQbSignIn = async () => {
|
||||
const result = await Axios.post("/qbo/authorize");
|
||||
window.location.href = result.data;
|
||||
};
|
||||
const qs = queryString.parse(location.search);
|
||||
const qs = queryString.parse(location.toString());
|
||||
|
||||
const { error } = qs;
|
||||
|
||||
@@ -39,7 +39,7 @@ export default function QboAuthorizeComponent() {
|
||||
// : {}),
|
||||
// });
|
||||
|
||||
history.push({ pathname: `/manage/accounting/receivables` });
|
||||
history({ pathname: `/manage/accounting/receivables` });
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [qs, location, setCookie]);
|
||||
|
||||
Reference in New Issue
Block a user