fixed translation bug
This commit is contained in:
@@ -1,10 +1,13 @@
|
|||||||
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",
|
||||||
@@ -21,8 +24,7 @@ export const getBorrowableItems = async (
|
|||||||
data: null,
|
data: null,
|
||||||
status: "error",
|
status: "error",
|
||||||
title: "Server error",
|
title: "Server error",
|
||||||
description:
|
description: t("serverError"),
|
||||||
"Ein Fehler ist auf dem Server aufgetreten. Manchmal hilft es, die Seite neu zu laden.",
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +50,7 @@ export const createLoan = async (
|
|||||||
itemIds: number[],
|
itemIds: number[],
|
||||||
startDate: string,
|
startDate: string,
|
||||||
endDate: string,
|
endDate: string,
|
||||||
note: string | null
|
note: string | null,
|
||||||
) => {
|
) => {
|
||||||
const response = await fetch(`${API_BASE}/api/loans/createLoan`, {
|
const response = await fetch(`${API_BASE}/api/loans/createLoan`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|||||||
@@ -84,6 +84,7 @@
|
|||||||
"contact": "Kontakt",
|
"contact": "Kontakt",
|
||||||
"take": "Abholen",
|
"take": "Abholen",
|
||||||
"return": "Zurückgeben",
|
"return": "Zurückgeben",
|
||||||
|
"serverError": "Serverfehler. Bitte versuchen Sie es später erneut, oder laden Sie die Seite neu.",
|
||||||
"take-loan-success": "Ausleihe erfolgreich abgeholt",
|
"take-loan-success": "Ausleihe erfolgreich abgeholt",
|
||||||
"return-loan-success": "Ausleihe erfolgreich zurückgegeben",
|
"return-loan-success": "Ausleihe erfolgreich zurückgegeben",
|
||||||
"network-error": "Netzwerkfehler. Kontaktieren Sie den Administrator.",
|
"network-error": "Netzwerkfehler. Kontaktieren Sie den Administrator.",
|
||||||
|
|||||||
@@ -82,6 +82,7 @@
|
|||||||
"contactPage_messagePlaceholder": "Enter your message here...",
|
"contactPage_messagePlaceholder": "Enter your message here...",
|
||||||
"contactPage_messageErrorText": "This field cannot be empty.",
|
"contactPage_messageErrorText": "This field cannot be empty.",
|
||||||
"contact": "Contact",
|
"contact": "Contact",
|
||||||
|
"serverError": "Server error. Please try again later, or refresh the page.",
|
||||||
"take": "Take",
|
"take": "Take",
|
||||||
"return": "Return",
|
"return": "Return",
|
||||||
"take-loan-success": "Loan taken successfully",
|
"take-loan-success": "Loan taken successfully",
|
||||||
|
|||||||
Reference in New Issue
Block a user