
- Removed notes - Updated readme - DB - Updated initial db schema - Updated db seed - Created source, station, and tag models - Libs - Create content source importer - UI - Added content source UI & routes - Updated page layout - Created <Breadcrumbs> component
13 lines
371 B
TypeScript
13 lines
371 B
TypeScript
import { prisma } from "~/db.server";
|
|
import type { PrismaTxClient } from "~/models/station.server";
|
|
import { slugify } from "~/utils";
|
|
|
|
export function upsertTagOnName(tag: string, p: PrismaTxClient = prisma) {
|
|
const slug = slugify(tag);
|
|
return p.tag.upsert({
|
|
where: { name: tag },
|
|
create: { name: tag, slug },
|
|
update: { slug }
|
|
});
|
|
}
|