Merge pull request 'Include slug namespace in the tables arrangements fetch endpoint' (#141) from fix-arrangements-api into main
All checks were successful
Playwright Tests / test (push) Has been skipped
Check usage of free licenses / build-static-assets (push) Successful in 45s
Build Nginx-based docker image / build-static-assets (push) Successful in 6m38s

Reviewed-on: #141
This commit is contained in:
bustikiller 2024-12-08 13:04:55 +00:00
commit 283d90c707

View File

@ -6,13 +6,14 @@ import React, { useState } from 'react';
import { TableArrangement, Guest } from '@/app/lib/definitions';
import { lusitana } from '@/app/ui/fonts';
import { Table } from '@/app/ui/components/table';
import { getSlug } from '@/app/lib/utils';
export default function Arrangement({ id }: { id: string }) {
const [tables, setTables] = useState<Array<TableArrangement>>([]);
function loadTables() {
fetch(`/api/tables_arrangements/${id}`)
fetch(`/api/${getSlug()}/tables_arrangements/${id}`)
.then((response) => response.json())
.then((data) => {
setTables(data.map((record: any) => {