diff --git a/ui/actions/lighthouse/findings.ts b/ui/actions/lighthouse/findings.ts index 5e43177b64..7773ffc447 100644 --- a/ui/actions/lighthouse/findings.ts +++ b/ui/actions/lighthouse/findings.ts @@ -8,6 +8,7 @@ export const getLighthouseFindings = async ({ query = "", sort = "", filters = {}, + fields = [], }) => { const headers = await getAuthHeaders({ contentType: false }); @@ -21,6 +22,9 @@ export const getLighthouseFindings = async ({ if (query) url.searchParams.append("filter[search]", query); if (sort) url.searchParams.append("sort", sort); + if (fields.length > 0) { + url.searchParams.append("fields[findings]", fields.join(",")); + } Object.entries(filters).forEach(([key, value]) => { url.searchParams.append(key, String(value)); diff --git a/ui/types/lighthouse/findings.ts b/ui/types/lighthouse/findings.ts index d889cb90fc..8a9343dd84 100644 --- a/ui/types/lighthouse/findings.ts +++ b/ui/types/lighthouse/findings.ts @@ -213,6 +213,31 @@ export const getFindingsSchema = z.object({ .describe( "The filters to apply. Default is {}. Only add necessary filters and ignore others. Generate the filters object **only** with non-empty values included.", ), + fields: z + .array( + z.enum([ + "uid", + "delta", + "status", + "status_extended", + "severity", + "check_id", + "check_metadata", + "raw_result", + "inserted_at", + "updated_at", + "first_seen_at", + "muted", + "muted_reason", + "url", + "scan", + "resources", + ]), + ) + .optional() + .describe( + "List of fields to include in the response. Use only available fields.", + ), }); // Get Metadata Info Schema