fix: odkaz Otvorit v Brevo vedie priamo na upravu kampane (uloha 17)
Namiesto napevno zadaneho zoznamu kampani (404) sa odkaz sklada z ID
kampane: app.brevo.com/marketing-campaign/edit/{id}.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2c3f09f18f
commit
21320e792b
5 files changed
+15
-7
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { getBrevoCampaignUrl } from '@/lib/brevo';
|
||||
|
||||
export async function POST(req: NextRequest) {
|
||||
try {
|
||||
@@ -63,7 +64,7 @@ export async function POST(req: NextRequest) {
|
||||
success: true,
|
||||
updated: true,
|
||||
campaignId: Number(existingCampaignId),
|
||||
brevoUrl: 'https://app.brevo.com/campaigns/listing',
|
||||
brevoUrl: getBrevoCampaignUrl(existingCampaignId),
|
||||
brevoListingUrl: 'https://app.brevo.com/campaigns/listing',
|
||||
message: 'Kampaň bola úspešne aktualizovaná v Brevo!'
|
||||
});
|
||||
@@ -113,7 +114,7 @@ export async function POST(req: NextRequest) {
|
||||
success: true,
|
||||
updated: false,
|
||||
campaignId: data.id,
|
||||
brevoUrl: 'https://app.brevo.com/campaigns/listing',
|
||||
brevoUrl: getBrevoCampaignUrl(data.id),
|
||||
brevoListingUrl: 'https://app.brevo.com/campaigns/listing',
|
||||
message: 'Kampaň bola úspešne vytvorená v Brevo!'
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { getBrevoCampaignUrl } from '@/lib/brevo';
|
||||
|
||||
export async function GET(req: NextRequest) {
|
||||
try {
|
||||
@@ -51,7 +52,7 @@ export async function GET(req: NextRequest) {
|
||||
name: data.name,
|
||||
status: data.status,
|
||||
subject: data.subject,
|
||||
brevoUrl: 'https://app.brevo.com/campaigns/listing',
|
||||
brevoUrl: getBrevoCampaignUrl(data.id),
|
||||
brevoListingUrl: 'https://app.brevo.com/campaigns/listing'
|
||||
});
|
||||
} catch (err: any) {
|
||||
|
||||
+3
-2
@@ -6,6 +6,7 @@ import { DEFAULT_CAMPAIGN, SUPABASE_ASSETS_BASE } from '@/lib/defaultCampaign';
|
||||
import { renderEmailHtml, renderSingleModuleHtml } from '@/lib/emailRenderer';
|
||||
import { supabase } from '@/lib/supabase';
|
||||
import { DEFAULT_BADGE_TEMPLATES } from '@/lib/badgeUtils';
|
||||
import { getBrevoCampaignUrl } from '@/lib/brevo';
|
||||
import { TopBar } from '@/components/editor/TopBar';
|
||||
import { ConfigPanel } from '@/components/editor/ConfigPanel';
|
||||
import { ProductImportModal } from '@/components/editor/ProductImportModal';
|
||||
@@ -144,7 +145,7 @@ export default function Home() {
|
||||
modules: enforceAnchors(dbItem.data.modules)
|
||||
});
|
||||
if (dbItem.brevo_campaign_id) {
|
||||
setBrevoUrl('https://app.brevo.com/campaigns/listing');
|
||||
setBrevoUrl(getBrevoCampaignUrl(dbItem.brevo_campaign_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -831,7 +832,7 @@ export default function Home() {
|
||||
setCampaign({ ...selected, modules: enforceAnchors(selected.modules) });
|
||||
setSelectedModuleId(selected.modules[1]?.id || selected.modules[0]?.id || null);
|
||||
if (selected.brevoCampaignId) {
|
||||
setBrevoUrl('https://app.brevo.com/campaigns');
|
||||
setBrevoUrl(getBrevoCampaignUrl(selected.brevoCampaignId));
|
||||
} else {
|
||||
setBrevoUrl(null);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user