maj url photo + page 404 + gestion programmation d'article
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { InterviewType } from "@prisma/client";
|
||||
import { InterviewType, ContentStatus } from "@prisma/client";
|
||||
import { generateSlug } from "@/lib/utils";
|
||||
|
||||
export async function createInterview(data: {
|
||||
@@ -20,6 +20,8 @@ export async function createInterview(data: {
|
||||
tags?: string[];
|
||||
metaTitle?: string;
|
||||
metaDescription?: string;
|
||||
publishedAt?: Date;
|
||||
status?: ContentStatus;
|
||||
}) {
|
||||
try {
|
||||
const slug = data.slug || generateSlug(data.title);
|
||||
@@ -29,6 +31,8 @@ export async function createInterview(data: {
|
||||
...data,
|
||||
slug,
|
||||
tags: data.tags || [],
|
||||
publishedAt: data.publishedAt || new Date(),
|
||||
status: data.status || ContentStatus.PUBLISHED,
|
||||
},
|
||||
});
|
||||
revalidatePath("/blog");
|
||||
@@ -54,6 +58,8 @@ export async function updateInterview(id: string, data: {
|
||||
tags?: string[];
|
||||
metaTitle?: string;
|
||||
metaDescription?: string;
|
||||
publishedAt?: Date;
|
||||
status?: ContentStatus;
|
||||
}) {
|
||||
try {
|
||||
const slug = data.slug || generateSlug(data.title);
|
||||
|
||||
Reference in New Issue
Block a user