Include slug namespace in the tables arrangements fetch endpoint
This commit is contained in:
parent
eddb1cab37
commit
066cab9da8
@ -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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user