fix(brand): sincronizacion bidireccional de linkedin_strategy_url y precarga automatica de campos b2b
This commit is contained in:
@@ -113,6 +113,7 @@ export async function GET(req: NextRequest) {
|
||||
const proObj = cs.prohibitions || {};
|
||||
const voiObj = cs.voice || {};
|
||||
const visObj = cs.visual || {};
|
||||
const liObj = cs.linkedin || {};
|
||||
|
||||
current = {
|
||||
...current,
|
||||
@@ -142,6 +143,14 @@ export async function GET(req: NextRequest) {
|
||||
emoji_policy: current.emoji_policy || proObj.emoji_policy || '',
|
||||
testimonials_policy: current.testimonials_policy || proObj.testimonials_policy || '',
|
||||
competitors_never_mention: current.competitors_never_mention?.length ? current.competitors_never_mention : (proObj.competitors_never_mention || []),
|
||||
linkedin_themes: current.linkedin_themes?.length ? current.linkedin_themes : (liObj.linkedin_themes || []),
|
||||
linkedin_formats: current.linkedin_formats?.length ? current.linkedin_formats : (liObj.linkedin_formats || []),
|
||||
thought_leadership: current.thought_leadership?.length ? current.thought_leadership : (liObj.thought_leadership || []),
|
||||
buyer_roles: current.buyer_roles?.length ? current.buyer_roles : (liObj.buyer_roles || []),
|
||||
case_study_angles: current.case_study_angles?.length ? current.case_study_angles : (liObj.case_study_angles || []),
|
||||
linkedin_cta: current.linkedin_cta?.length ? current.linkedin_cta : (liObj.linkedin_cta || []),
|
||||
abm_notes: current.abm_notes || liObj.abm_notes || '',
|
||||
linkedin_strategy_url: current.linkedin_strategy_url || liObj.strategy_url || '',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -323,6 +332,17 @@ export async function PUT(req: NextRequest) {
|
||||
testimonials_policy: book.testimonials_policy || existingStyle.prohibitions?.testimonials_policy || '',
|
||||
competitors_never_mention: book.competitors_never_mention?.length ? book.competitors_never_mention : existingStyle.prohibitions?.competitors_never_mention || [],
|
||||
},
|
||||
linkedin: {
|
||||
...(existingStyle.linkedin || {}),
|
||||
linkedin_themes: book.linkedin_themes?.length ? book.linkedin_themes : existingStyle.linkedin?.linkedin_themes || [],
|
||||
linkedin_formats: book.linkedin_formats?.length ? book.linkedin_formats : existingStyle.linkedin?.linkedin_formats || [],
|
||||
thought_leadership: book.thought_leadership?.length ? book.thought_leadership : existingStyle.linkedin?.thought_leadership || [],
|
||||
buyer_roles: book.buyer_roles?.length ? book.buyer_roles : existingStyle.linkedin?.buyer_roles || [],
|
||||
case_study_angles: book.case_study_angles?.length ? book.case_study_angles : existingStyle.linkedin?.case_study_angles || [],
|
||||
linkedin_cta: book.linkedin_cta?.length ? book.linkedin_cta : existingStyle.linkedin?.linkedin_cta || [],
|
||||
abm_notes: book.abm_notes || existingStyle.linkedin?.abm_notes || '',
|
||||
strategy_url: book.linkedin_strategy_url || existingStyle.linkedin?.strategy_url || '',
|
||||
},
|
||||
};
|
||||
|
||||
await admin
|
||||
|
||||
Reference in New Issue
Block a user