latest update 27 jul 24

This commit is contained in:
zadit
2024-07-27 10:58:43 +07:00
commit 4f43b46e5f
66 changed files with 24005 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import API_BASE_URL from "../config.js";
function getAuthToken() {
return localStorage.getItem("auth");
}
export async function getOwnedCafes(userId) {
try {
const response = await fetch(
`${API_BASE_URL}/cafe/get-cafe-by-ownerId/` + userId,
{
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${getAuthToken()}`,
},
},
);
if (!response.ok) {
throw new Error("Failed to fetch cart details");
}
const cafes = await response.json();
return cafes;
} catch (error) {
console.error("Error:", error);
}
}