Skip to content

aiTriageEnabled setting is not persisted when creating PAGE_CONTENT or PRODUCT_PRICE monitors #16

Description

@Adityakk9031

Describe the bug

When a user adds a new monitor (target) of category PAGE_CONTENT or PRODUCT_PRICE using the dashboard, the target creation API endpoint correctly parses the aiTriageEnabled parameter from the request but omits it in the database insertion statement. As a result, the monitor is always created with the database default value (false), ignoring the user's initial selection.

Steps to reproduce

  1. Attempt to add a new PAGE_CONTENT page monitor via the /api/websites/[id]/targets POST endpoint.
  2. Pass aiTriageEnabled: true in the JSON request body.
  3. Inspect the newly created target row in the database.
  4. Notice that aiTriageEnabled is set to false.

Expected behavior

The aiTriageEnabled value should be correctly saved to the database alongside other fields like aiChangeSummaryEnabled and checkIntervalHours.

Code Location

In route.ts:L168-L180:

  const targetId = newId("tgt");
  await db.insert(schema.target).values({
    id: targetId,
    websiteId: id,
    kind,
    pageUrl,
    watchNote,
    notificationDestinationId: destId,
    externalNotify: wantOutbound,
    enabled: true,
    checkIntervalHours,
    aiChangeSummaryEnabled, // <--- missing aiTriageEnabled here!
    createdAt: new Date(),
  });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions