Manuel Bustillo
501bb3a81a
All checks were successful
Playwright Tests / test (pull_request) Has been skipped
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m12s
Add copyright notice / copyright_notice (pull_request) Successful in 1m32s
Build Nginx-based docker image / build-static-assets (push) Successful in 6m2s
20 lines
603 B
TypeScript
20 lines
603 B
TypeScript
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
|
|
|
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 [];
|
|
});
|
|
} |