umstellung auf claud
This commit is contained in:
1 parent
79c5f0c5cd
commit
5bb4e063da
171 files changed
+5471
-1333
No files matched your search
@@ -1,50 +1,42 @@
|
||||
import { notFound, redirect } from 'next/navigation';
|
||||
import { api_anlage_getSelected } from '@/actions/rk/api-anlage';
|
||||
import { api_groups, api_groups_byId } from '@/actions/rk2/api-groups';
|
||||
import Breadcrumbs from '@/components/ui/navigation/breadcrumbs';
|
||||
import { GroupEdit } from '@/components/rk2/groups/groupEdit';
|
||||
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_units_byId } from "@/actions/rk2/api-units";
|
||||
export default async function GroupEditPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ id: string }>;
|
||||
}) {
|
||||
const { id } = await params;
|
||||
const anlage = await api_anlage_getSelected();
|
||||
if (!anlage?.id) {
|
||||
redirect('/projekte');
|
||||
}
|
||||
|
||||
import { api_anlage_getSelected } from "@/actions/rk/api-anlage";
|
||||
import { UnitCreateForm } from "@/components/rk2/units/unit_createForm";
|
||||
const groups = await api_groups();
|
||||
let group;
|
||||
if (id !== 'new') {
|
||||
const result = await api_groups_byId(id);
|
||||
if (!result.success || !result.data) {
|
||||
notFound();
|
||||
}
|
||||
group = result.data;
|
||||
}
|
||||
|
||||
import Link from "next/link";
|
||||
import { UnitEdit } from "@/components/rk2/units/unitEdit";
|
||||
import { api_groups, api_groups_byId } from "@/actions/rk2/api-groups";
|
||||
import { componentDefaults, componentTypeDefinitions } from "@/actions/rk2/api-compTypes";
|
||||
const breadcrumb = [
|
||||
{ label: 'Anlage', href: '/' },
|
||||
{ label: 'Gruppen', href: '/groups' },
|
||||
{ label: group?.name ?? 'Neue Gruppe' },
|
||||
];
|
||||
|
||||
import Breadcrumbs from "@/components/ui/navigation/breadcrumbs";
|
||||
import { GroupForm } from "@/components/rk2/groups/groupForm";
|
||||
import { GroupEdit } from "@/components/rk2/groups/groupEdit";
|
||||
|
||||
type Props = {
|
||||
params: Promise<{
|
||||
id: string;
|
||||
}>;
|
||||
};
|
||||
|
||||
|
||||
|
||||
export default async function PageGroupEdit({ params }: Props) {
|
||||
|
||||
const { id } = await params;
|
||||
const resultFindGroupById = await api_groups_byId(id);
|
||||
const anlage = await api_anlage_getSelected();
|
||||
const group = resultFindGroupById.data;
|
||||
const groups = await api_groups();
|
||||
|
||||
const breadcrumb = [{ label: "RK", href: "/" },{ label: "Anlage", href: "/" },{ label: "Groups", href: "/groups" }, { label: "Edit" }, { label: group.name }]
|
||||
|
||||
if (!resultFindGroupById.success) return <div>Grouppe nicht gefunden {resultFindGroupById.errors} {id}</div>
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<div>
|
||||
<Breadcrumbs items={breadcrumb}/>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col m-4 w-300 ">
|
||||
|
||||
<GroupEdit anlage={anlage} selectedGroup={group} groups={groups} />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<Breadcrumbs items={breadcrumb} />
|
||||
<div className="max-w-3xl">
|
||||
<GroupEdit anlage={anlage} selectedGroup={group} groups={groups} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user