remove fetchItems
This commit is contained in:
@@ -17,7 +17,7 @@ import { mapValueToColor } from "../../util/ColorUtil.tsx";
|
|||||||
import { useAccount } from "../AccountProvider.tsx";
|
import { useAccount } from "../AccountProvider.tsx";
|
||||||
import {
|
import {
|
||||||
deleteItemQuery,
|
deleteItemQuery,
|
||||||
fetchItems,
|
fetchItemList,
|
||||||
updateItemAdmin,
|
updateItemAdmin,
|
||||||
} from "../query/Queries.tsx";
|
} from "../query/Queries.tsx";
|
||||||
import ItemImageDialog from "./ItemImageDialog.tsx";
|
import ItemImageDialog from "./ItemImageDialog.tsx";
|
||||||
@@ -56,8 +56,8 @@ export default function ItemsInfo() {
|
|||||||
const { user: loginData } = useAccount();
|
const { user: loginData } = useAccount();
|
||||||
|
|
||||||
const { data } = useQuery({
|
const { data } = useQuery({
|
||||||
queryKey: ["fetchItems", loginData],
|
queryKey: ["fetchItemList", loginData],
|
||||||
queryFn: () => fetchItems(),
|
queryFn: () => fetchItemList(),
|
||||||
retry: 3,
|
retry: 3,
|
||||||
retryDelay: 1000,
|
retryDelay: 1000,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -224,15 +224,6 @@ export const fetchAccounts = async (loginData: User) => {
|
|||||||
return response.json();
|
return response.json();
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fetchItems = async () => {
|
|
||||||
//TODO: remove and use above
|
|
||||||
const response = await fetch("http://localhost:8085/article/all");
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error("fetching items failed");
|
|
||||||
}
|
|
||||||
return response.json();
|
|
||||||
};
|
|
||||||
|
|
||||||
export const fetchStatisticsVolume = async (loginData: User) => {
|
export const fetchStatisticsVolume = async (loginData: User) => {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
"http://localhost:8085/statistics/volume?email=" +
|
"http://localhost:8085/statistics/volume?email=" +
|
||||||
|
|||||||
Reference in New Issue
Block a user