feat: initialize Prisma schema and scaffold core application modules including auth, blogs, events, and business directories
Some checks failed
Build and Push App / build (push) Failing after 47s
Some checks failed
Build and Push App / build (push) Failing after 47s
This commit is contained in:
@@ -3,9 +3,11 @@
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { InterviewType } from "@prisma/client";
|
||||
import { generateSlug } from "@/lib/utils";
|
||||
|
||||
export async function createInterview(data: {
|
||||
title: string;
|
||||
slug?: string;
|
||||
guestName: string;
|
||||
companyName: string;
|
||||
role: string;
|
||||
@@ -15,10 +17,19 @@ export async function createInterview(data: {
|
||||
content?: string;
|
||||
excerpt: string;
|
||||
duration?: string;
|
||||
tags?: string[];
|
||||
metaTitle?: string;
|
||||
metaDescription?: string;
|
||||
}) {
|
||||
try {
|
||||
const slug = data.slug || generateSlug(data.title);
|
||||
|
||||
const interview = await prisma.interview.create({
|
||||
data,
|
||||
data: {
|
||||
...data,
|
||||
slug,
|
||||
tags: data.tags || [],
|
||||
},
|
||||
});
|
||||
revalidatePath("/blog");
|
||||
return { success: true, data: interview };
|
||||
@@ -30,6 +41,7 @@ export async function createInterview(data: {
|
||||
|
||||
export async function updateInterview(id: string, data: {
|
||||
title: string;
|
||||
slug?: string;
|
||||
guestName: string;
|
||||
companyName: string;
|
||||
role: string;
|
||||
@@ -39,11 +51,20 @@ export async function updateInterview(id: string, data: {
|
||||
content?: string;
|
||||
excerpt: string;
|
||||
duration?: string;
|
||||
tags?: string[];
|
||||
metaTitle?: string;
|
||||
metaDescription?: string;
|
||||
}) {
|
||||
try {
|
||||
const slug = data.slug || generateSlug(data.title);
|
||||
|
||||
const interview = await prisma.interview.update({
|
||||
where: { id },
|
||||
data,
|
||||
data: {
|
||||
...data,
|
||||
slug,
|
||||
tags: data.tags || [],
|
||||
},
|
||||
});
|
||||
revalidatePath("/blog");
|
||||
return { success: true, data: interview };
|
||||
|
||||
Reference in New Issue
Block a user