reverse order of activity log

This commit is contained in:
Khalim Conn-Kowlessar 2026-05-07 21:09:28 +00:00
parent 43e3d0b8f3
commit 5eced11db1

View file

@ -6,7 +6,7 @@ import {
} from "@/app/db/schema/approvals";
import { portfolioCapabilities } from "@/app/db/schema/portfolio";
import { user } from "@/app/db/schema/users";
import { and, eq, inArray, sql } from "drizzle-orm";
import { and, desc, eq, inArray, sql } from "drizzle-orm";
import { z } from "zod";
import { getServerSession } from "next-auth";
import { AuthOptions } from "@/app/api/auth/[...nextauth]/authOptions";
@ -106,7 +106,7 @@ export async function GET(
.from(dealMeasureApprovalEvents)
.leftJoin(user, eq(user.id, dealMeasureApprovalEvents.actedBy))
.where(inArray(dealMeasureApprovalEvents.hubspotDealId, dealIds))
.orderBy(dealMeasureApprovalEvents.actedAt);
.orderBy(desc(dealMeasureApprovalEvents.actedAt));
const events = eventRows.map((e) => ({
id: e.id.toString(),