fixed bug: cannot return loan

This commit is contained in:
2026-02-20 12:02:33 +01:00
parent 06976f7972
commit a8dab549af

View File

@@ -1,13 +1,10 @@
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import { API_BASE } from "@/config/api.config"; import { API_BASE } from "@/config/api.config";
import { useTranslation } from "react-i18next";
export const getBorrowableItems = async ( export const getBorrowableItems = async (
startDate: string, startDate: string,
endDate: string, endDate: string,
) => { ) => {
const { t } = useTranslation();
try { try {
const response = await fetch(`${API_BASE}/api/loans/borrowable-items`, { const response = await fetch(`${API_BASE}/api/loans/borrowable-items`, {
method: "POST", method: "POST",
@@ -24,7 +21,8 @@ export const getBorrowableItems = async (
data: null, data: null,
status: "error", status: "error",
title: "Server error", title: "Server error",
description: t("serverError"), description:
"An error occurred on the server. Sometimes reloading the page helps. Otherwise, please contact the administrator.",
}; };
} }