working on material and table
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user