Skip to content

Commit

Permalink
feat(persons): single person query via postgres (#21587)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra authored Apr 16, 2024
1 parent 957bc3c commit 5f5d6a9
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions frontend/src/scenes/persons/personsLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,26 +101,6 @@ export const personsLogic = kea<personsLogicType>([
null as PersonType | null,
{
loadPerson: async ({ id }): Promise<PersonType | null> => {
if (values.featureFlags[FEATURE_FLAGS.PERSONS_HOGQL_QUERY]) {
const response = await hogqlQuery(
'select id, groupArray(pdi.distinct_id) as distinct_ids, properties, is_identified, created_at from persons where pdi.distinct_id={distinct_id} group by id, properties, is_identified, created_at',
{ distinct_id: id }
)
const row = response?.results?.[0]
if (row) {
const person: PersonType = {
id: row[0],
uuid: row[0],
distinct_ids: row[1],
properties: JSON.parse(row[2] || '{}'),
is_identified: !!row[3],
created_at: row[4],
}
actions.reportPersonDetailViewed(person)
return person
}
}

const response = await api.persons.list({ distinct_id: id })
const person = response.results[0]
if (person) {
Expand Down

0 comments on commit 5f5d6a9

Please sign in to comment.