Comments, appointments adjustments, fixed some issues

This commit is contained in:
augmentedpotato
2026-04-20 19:19:30 -06:00
parent d3b9c51952
commit 2cb0a94bbb
34 changed files with 402 additions and 104 deletions

View File

@@ -1,5 +1,7 @@
//Base path for all cart API calls
const BASE = "/api/v1/cart";
//Returns the standard headers needed for authenticated requests
function authHeaders(token) {
return {
"Content-Type": "application/json",
@@ -7,6 +9,7 @@ function authHeaders(token) {
};
}
//Parses the response and throws an error if the request failed
async function handleResponse(res) {
if (res.status === 204) return null;
const data = await res.json();

View File

@@ -1,7 +1,9 @@
import { Client } from "@stomp/stompjs";
//Backend URL for the WebSocket connection, empty string means same origin
const BACKEND_URL = process.env.NEXT_PUBLIC_BACKEND_URL || "";
//Creates a STOMP client that connects to the chat WebSocket with the user's token
export function createStompClient(token) {
return new Client({
webSocketFactory: () => {

View File

@@ -1,3 +1,4 @@
//Fetches every page from a paginated API and returns all items in one array
export async function fetchAllPages(urlBuilder) {
const items = [];
let page = 0;