File tree Expand file tree Collapse file tree
apps/mobile/src/features/inbox Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { selectReportRepository } from "@posthog/core/inbox/reportArtefacts " ;
1+ import { extractRepoSelectionRepository } from "@posthog/core/inbox/artefacts " ;
22import { getPostHogApiClient } from "@/lib/posthogApiClient" ;
33
44/** Resolve the repository associated with a signal report via its repo_selection artefact. */
@@ -7,5 +7,5 @@ export async function getReportRepository(
77) : Promise < string | null > {
88 const { results } =
99 await getPostHogApiClient ( ) . getSignalReportArtefacts ( reportId ) ;
10- return selectReportRepository ( results ) ;
10+ return extractRepoSelectionRepository ( results ) ;
1111}
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -81,25 +81,3 @@ export function selectPriorityExplanation(
8181 ?. content . explanation || null
8282 ) ;
8383}
84-
85- export function selectReportRepository (
86- artefacts : ReportArtefact [ ] ,
87- ) : string | null {
88- const artefact = artefacts . find ( ( item ) => item . type === "repo_selection" ) ;
89- if ( ! artefact ) return null ;
90-
91- let content : unknown = artefact . content ;
92- if ( typeof content === "string" ) {
93- const serialized = content ;
94- try {
95- content = JSON . parse ( serialized ) ;
96- } catch {
97- return serialized . toLowerCase ( ) ;
98- }
99- }
100-
101- if ( typeof content !== "object" || content === null ) return null ;
102- const record = content as Record < string , unknown > ;
103- const repository = record . repository ?? record . repo ;
104- return typeof repository === "string" ? repository . toLowerCase ( ) : null ;
105- }
You can’t perform that action at this time.
0 commit comments