Merge dev into main
This commit is contained in:
@ -1,14 +1,18 @@
|
||||
import { migrateArtTags } from "@/actions/tags/migrateArtTags";
|
||||
import { migrateArtworkTagJoin } from "@/actions/tags/migrateArtworkTagJoin";
|
||||
import TagTabs from "@/components/tags/TagTabs";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { PlusCircleIcon } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
|
||||
async function migrateTags() {
|
||||
async function migrateArtworkTagJoinCopy() {
|
||||
"use server";
|
||||
await migrateArtworkTagJoin();
|
||||
}
|
||||
|
||||
await migrateArtTags();
|
||||
async function migrateArtworkTagJoinDropOld() {
|
||||
"use server";
|
||||
await migrateArtworkTagJoin({ dropOld: true });
|
||||
}
|
||||
|
||||
export default async function ArtTagsPage() {
|
||||
@ -58,9 +62,14 @@ export default async function ArtTagsPage() {
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col gap-2 sm:flex-row sm:items-center">
|
||||
<form action={migrateTags}>
|
||||
<form action={migrateArtworkTagJoinCopy}>
|
||||
<Button type="submit" variant="secondary" className="h-11">
|
||||
Migrate old tags
|
||||
Copy tag relations
|
||||
</Button>
|
||||
</form>
|
||||
<form action={migrateArtworkTagJoinDropOld}>
|
||||
<Button type="submit" variant="destructive" className="h-11">
|
||||
Copy + drop old
|
||||
</Button>
|
||||
</form>
|
||||
<Button asChild className="h-11 gap-2">
|
||||
@ -70,15 +79,17 @@ export default async function ArtTagsPage() {
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</header>
|
||||
</header >
|
||||
|
||||
{rows.length > 0 ? (
|
||||
<TagTabs tags={rows} />
|
||||
) : (
|
||||
<p className="text-muted-foreground">
|
||||
There are no tags yet. Consider adding some!
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
{
|
||||
rows.length > 0 ? (
|
||||
<TagTabs tags={rows} />
|
||||
) : (
|
||||
<p className="text-muted-foreground">
|
||||
There are no tags yet. Consider adding some!
|
||||
</p>
|
||||
)
|
||||
}
|
||||
</div >
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user