working on material and table

This commit is contained in:
zadit frontend
2024-08-03 15:05:10 +00:00
parent 5b4de33afb
commit 6461279b06
8 changed files with 631 additions and 210 deletions

View File

@@ -63,3 +63,19 @@ export const getMaterialMutationById = async (mutationId) => {
throw error;
}
};
// Get all material mutations by materialId
export const getMaterialMutationsByMaterialId = async (materialId) => {
try {
const response = await fetch(
`${API_BASE_URL}/mutation/get-material-mutations-by-material/${materialId}`,
getHeaders()
);
if (!response.ok)
throw new Error("Failed to retrieve material mutations by material ID.");
return await response.json();
} catch (error) {
console.error(error);
throw error;
}
};

View File

@@ -25,7 +25,21 @@ export const useNavigationHelpers = (shopId, tableId) => {
// Perform the navigation
navigate(url);
};
const goToScan = () => {
// Construct the base URL for the shop
let url = `/scan`;
// Perform the navigation
navigate(url);
};
const goToNonTable = () => {
// Construct the base URL for the shop
let url = `/${shopId}`;
// Perform the navigation
navigate(url);
};
const goToShop = () => {
// Construct the base URL for the shop
let url = `/${shopId}`;
@@ -103,5 +117,7 @@ export const useNavigationHelpers = (shopId, tableId) => {
goToTransactions,
goToGuestSideLogin,
goToAdminCafes,
goToScan,
goToNonTable,
};
};