const API_URL = "http://192.168.1.36:8000/tables/";

export async function getTables() {
	const res = await fetch(API_URL);
	return res.json();
}

export async function getTable(tableId: number) {
	const res = await fetch(`${API_URL}/${tableId}`);
	return res.json();
}

export async function createTable(tableData: any) {
	const res = await fetch(API_URL, {
		method: "POST",
		headers: { "Content-Type": "application/json" },
		body: JSON.stringify(tableData),
	});
	return res.json();
}
