Add title field to EmailTemplate model and update UI
This commit is contained in:
@ -55,17 +55,18 @@ export async function PUT(
|
||||
}
|
||||
|
||||
const data = await request.json();
|
||||
const { content } = data;
|
||||
const { title, content } = data;
|
||||
|
||||
// Validate required fields
|
||||
if (!content) {
|
||||
if (!title || !content) {
|
||||
return NextResponse.json(
|
||||
{ error: 'Content is required' },
|
||||
{ error: 'Title and content are required' },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
// Update email template fields
|
||||
emailTemplate.title = title;
|
||||
emailTemplate.content = content;
|
||||
|
||||
// Save the updated email template
|
||||
|
||||
Reference in New Issue
Block a user