Include slug namespace in the tables arrangements fetch endpoint
All checks were successful
Playwright Tests / test (pull_request) Has been skipped
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m37s
Add copyright notice / copyright_notice (pull_request) Successful in 2m10s

This commit is contained in:
Manuel Bustillo 2024-12-08 14:02:29 +01:00
parent eddb1cab37
commit 066cab9da8

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) => {