Postgresql Array Agg Group By In React Which Type