/* Copyright (C) 2024 Manuel Bustillo*/ import { TableArrangement } from '@/app/lib/definitions'; import { getSlug } from '../lib/utils'; export function loadTableSimulations(onLoad?: (tableSimulations: TableArrangement[]) => void) { fetch(`/api/${getSlug()}/tables_arrangements`) .then((response) => response.json()) .then((data) => { onLoad && onLoad(data.map((record: any) => { return ({ id: record.id, name: record.name, discomfort: record.discomfort, }); })); }, (error) => { return []; }); }