MCPcopy
hub / github.com/PostHog/posthog / patchResponseFor

Function patchResponseFor

frontend/src/scenes/insights/insightLogic.test.ts:56–71  ·  view source on GitHub ↗
(
    payload: Record<string, any>,
    id: string,
    filters: Record<string, any>
)

Source from the content-addressed store, hash-verified

54}
55
56const patchResponseFor = (
57 payload: Record<string, any>,
58 id: string,
59 filters: Record<string, any>
60): Record<string, any> => {
61 return {
62 result: id === '42' ? ['result from api'] : null,
63 id: id === '42' ? 42 : 43,
64 short_id: id === '42' ? Insight42 : Insight43,
65 filters: filters || API_FILTERS,
66 name: id === '42' ? undefined : 'Foobar 43',
67 description: id === '42' ? undefined : 'Lorem ipsum.',
68 tags: id === '42' ? undefined : ['good'],
69 dashboards: payload['dashboards'],
70 }
71}
72
73function insightModelWith(properties: Record<string, any>): InsightModel {
74 return {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…