Include slug namespace in the tables arrangements fetch endpoint #141
@ -6,13 +6,14 @@ import React, { useState } from 'react';
|
|||||||
import { TableArrangement, Guest } from '@/app/lib/definitions';
|
import { TableArrangement, Guest } from '@/app/lib/definitions';
|
||||||
import { lusitana } from '@/app/ui/fonts';
|
import { lusitana } from '@/app/ui/fonts';
|
||||||
import { Table } from '@/app/ui/components/table';
|
import { Table } from '@/app/ui/components/table';
|
||||||
|
import { getSlug } from '@/app/lib/utils';
|
||||||
|
|
||||||
export default function Arrangement({ id }: { id: string }) {
|
export default function Arrangement({ id }: { id: string }) {
|
||||||
|
|
||||||
const [tables, setTables] = useState<Array<TableArrangement>>([]);
|
const [tables, setTables] = useState<Array<TableArrangement>>([]);
|
||||||
|
|
||||||
function loadTables() {
|
function loadTables() {
|
||||||
fetch(`/api/tables_arrangements/${id}`)
|
fetch(`/api/${getSlug()}/tables_arrangements/${id}`)
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
setTables(data.map((record: any) => {
|
setTables(data.map((record: any) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user