feat: implement event submission flow with image upload and modal interface
This commit is contained in:
@@ -11,6 +11,7 @@ export async function createNews(data: {
|
||||
author: string;
|
||||
imageUrl: string;
|
||||
tags?: string[];
|
||||
sources?: any;
|
||||
}) {
|
||||
try {
|
||||
const slug = data.title
|
||||
@@ -26,12 +27,13 @@ export async function createNews(data: {
|
||||
author: data.author,
|
||||
imageUrl: data.imageUrl,
|
||||
tags: data.tags || [],
|
||||
status: ContentStatus.PENDING, // Always pending for user submission
|
||||
sources: data.sources || [],
|
||||
status: 'PENDING' as ContentStatus, // Always pending for user submission
|
||||
slug: `${slug}-${Math.random().toString(36).substring(2, 7)}`
|
||||
}
|
||||
});
|
||||
|
||||
revalidatePath("/blog");
|
||||
revalidatePath("/actualites");
|
||||
return { success: true, post };
|
||||
} catch (error) {
|
||||
console.error("Failed to create news:", error);
|
||||
|
||||
Reference in New Issue
Block a user