remove fetchItems
This commit is contained in:
@@ -17,7 +17,7 @@ import { mapValueToColor } from "../../util/ColorUtil.tsx";
|
||||
import { useAccount } from "../AccountProvider.tsx";
|
||||
import {
|
||||
deleteItemQuery,
|
||||
fetchItems,
|
||||
fetchItemList,
|
||||
updateItemAdmin,
|
||||
} from "../query/Queries.tsx";
|
||||
import ItemImageDialog from "./ItemImageDialog.tsx";
|
||||
@@ -56,8 +56,8 @@ export default function ItemsInfo() {
|
||||
const { user: loginData } = useAccount();
|
||||
|
||||
const { data } = useQuery({
|
||||
queryKey: ["fetchItems", loginData],
|
||||
queryFn: () => fetchItems(),
|
||||
queryKey: ["fetchItemList", loginData],
|
||||
queryFn: () => fetchItemList(),
|
||||
retry: 3,
|
||||
retryDelay: 1000,
|
||||
});
|
||||
|
||||
@@ -224,15 +224,6 @@ export const fetchAccounts = async (loginData: User) => {
|
||||
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) => {
|
||||
const response = await fetch(
|
||||
"http://localhost:8085/statistics/volume?email=" +
|
||||
|
||||
Reference in New Issue
Block a user