Skip to content

Commit b1b5611

Browse files
committed
fix(ahrefs): split shared date subBlock id for datetime-format operations
site_audit_page_explorer and rank_tracker_serp_overview both reused the generic 'date' subBlock id with YYYY-MM-DDThh:mm:ss semantics, while every other operation using that same id expects YYYY-MM-DD. Switching operations without clearing the field could carry a stale wrong-format value into the new operation's request. Split into distinct ids (crawlDate, asOfDate) mapped back to each tool's date param in tools.config.params.
1 parent 48fbdfd commit b1b5611

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

apps/sim/blocks/blocks/ahrefs.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ export const AhrefsBlock: BlockConfig<AhrefsResponse> = {
855855
mode: 'advanced',
856856
},
857857
{
858-
id: 'date',
858+
id: 'crawlDate',
859859
title: 'Crawl Date',
860860
type: 'short-input',
861861
placeholder: 'YYYY-MM-DDThh:mm:ss (defaults to most recent crawl)',
@@ -976,7 +976,7 @@ export const AhrefsBlock: BlockConfig<AhrefsResponse> = {
976976
mode: 'advanced',
977977
},
978978
{
979-
id: 'date',
979+
id: 'asOfDate',
980980
title: 'As Of',
981981
type: 'short-input',
982982
placeholder: 'YYYY-MM-DDThh:mm:ss (defaults to latest)',
@@ -1185,6 +1185,8 @@ export const AhrefsBlock: BlockConfig<AhrefsResponse> = {
11851185
if (params.topPositions) result.topPositions = Number(params.topPositions)
11861186
if (params.locationId) result.locationId = Number(params.locationId)
11871187
if (params.offset) result.offset = Number(params.offset)
1188+
if (params.crawlDate) result.date = params.crawlDate
1189+
if (params.asOfDate) result.date = params.asOfDate
11881190
return result
11891191
},
11901192
},
@@ -1233,6 +1235,14 @@ export const AhrefsBlock: BlockConfig<AhrefsResponse> = {
12331235
},
12341236
issueId: { type: 'string', description: 'Site Audit issue ID to filter affected pages' },
12351237
offset: { type: 'number', description: 'Number of results to skip, for pagination' },
1238+
crawlDate: {
1239+
type: 'string',
1240+
description: 'Site Audit crawl date/time in YYYY-MM-DDThh:mm:ss format',
1241+
},
1242+
asOfDate: {
1243+
type: 'string',
1244+
description: 'Rank Tracker SERP snapshot date/time in YYYY-MM-DDThh:mm:ss format',
1245+
},
12361246
},
12371247
outputs: {
12381248
// Domain Rating output

0 commit comments

Comments
 (0)