import { Form } from "@/payload-types";

export async function fetchFormREST(id: number) {
  const req = await fetch(`/api/forms/${id}`);
  if (req.ok) {
    const resData = (await req.json()) as Form;
    return resData;
  } else {
    return null;
  }
}
