Artikel DB struktur geändert von CODEX
This commit is contained in:
1 parent
0c0a678eaa
commit
9c18234efe
95 files changed
+3872
-2316
No files matched your search
@@ -1,26 +1,33 @@
|
||||
import { manufacturerFindAll } from "../../../actions/manufacturer.actions";
|
||||
import { articleFindAll } from "../../../actions/article.actions";
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../../../../apps/frontend/_config/sites";
|
||||
import { ArticleList } from "../../../components/article/articleList";
|
||||
import { Icon, CirclePlus } from "lucide-react";
|
||||
import {
|
||||
articleFindAll,
|
||||
articleMigrationStatus,
|
||||
} from '../../../actions/article.actions';
|
||||
import Link from 'next/link';
|
||||
import { sites } from '../../../_config/sites';
|
||||
import { ArticleList } from '../../../components/article/articleList';
|
||||
|
||||
interface Props { }
|
||||
|
||||
export default async function ArticlePage({ }: Props) {
|
||||
|
||||
|
||||
const manufacturer = await manufacturerFindAll();
|
||||
const artikel = await articleFindAll();
|
||||
|
||||
if (!manufacturer) return <div>Keine Hersteller gefunden</div>
|
||||
|
||||
return <div className="p-4 mb-4">
|
||||
<div className="">
|
||||
<Link href={`${sites.article.new.url}`} className="text-sky-300 text-black"><CirclePlus color="green" />neu </Link>
|
||||
</div>
|
||||
<ArticleList articles={artikel}></ArticleList>
|
||||
<Link href={`${sites.main.url}`} className="text-sky-300">zurück</Link>
|
||||
</div>
|
||||
|
||||
}
|
||||
export default async function ArticlePage() {
|
||||
const [articles, migration] = await Promise.all([
|
||||
articleFindAll(),
|
||||
articleMigrationStatus(),
|
||||
]);
|
||||
return (
|
||||
<main className="p-6">
|
||||
<h1 className="text-xl mb-4">Artikel</h1>
|
||||
<Link className="text-sky-700" href={sites.article.new.url}>
|
||||
Artikel anlegen
|
||||
</Link>
|
||||
{migration.pendingLegacyArticles > 0 && (
|
||||
<p role="status" className="border rounded p-3 my-3">
|
||||
Es gibt noch {migration.pendingLegacyArticles} bisherige Artikel, die
|
||||
vor ihrer Nutzung in die neue Artikelstruktur übernommen werden
|
||||
müssen.
|
||||
</p>
|
||||
)}
|
||||
<ArticleList articles={articles} />
|
||||
<Link className="text-sky-700" href={sites.main.url}>
|
||||
Zurück
|
||||
</Link>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user