Include slug namespace in the tables arrangements fetch endpoint #141

Merged
bustikiller merged 1 commits from fix-arrangements-api into main 2024-12-08 13:04:55 +00:00
Showing only changes of commit 066cab9da8 - Show all commits

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