fix
This commit is contained in:
parent
73d29e20da
commit
4fa45a2f09
@ -9,6 +9,8 @@ import {
|
|||||||
} from "semantic-ui-react";
|
} from "semantic-ui-react";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
|
import useGlobal from "../../../../utils/global_state";
|
||||||
|
|
||||||
function ReceiptEntery(props) {
|
function ReceiptEntery(props) {
|
||||||
// console.log(
|
// console.log(
|
||||||
// props.activeIndex,
|
// props.activeIndex,
|
||||||
@ -49,6 +51,8 @@ function Receipts() {
|
|||||||
const [receiptsLoaded, setReceiptsLoaded] = useState(false);
|
const [receiptsLoaded, setReceiptsLoaded] = useState(false);
|
||||||
const [page, setPage] = useState(1);
|
const [page, setPage] = useState(1);
|
||||||
const [activeIndex, setActiveIndex] = useState(-1);
|
const [activeIndex, setActiveIndex] = useState(-1);
|
||||||
|
const [globalState, globalActions] = useGlobal();
|
||||||
|
console.log("TOKEN: ", globalState.auth_token);
|
||||||
|
|
||||||
const handleClick = (oldIndex, index) => {
|
const handleClick = (oldIndex, index) => {
|
||||||
console.log(oldIndex, index);
|
console.log(oldIndex, index);
|
||||||
@ -60,7 +64,9 @@ function Receipts() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("Fetch data...");
|
console.log("Fetch data...");
|
||||||
axios
|
axios
|
||||||
.get("/api/receipts/")
|
.get("/api/receipts/", {
|
||||||
|
headers: { Authorization: `Token ${globalState.auth_token}` }
|
||||||
|
})
|
||||||
.then(resp => {
|
.then(resp => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log(resp.data.results);
|
console.log(resp.data.results);
|
||||||
|
Loading…
Reference in New Issue
Block a user