Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions services/dashboard/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ export const vexaAPI = {
nativeId: string,
meetingId?: string
): Promise<{ meeting: Meeting; segments: TranscriptSegment[]; recordings: RecordingData[] }> {
const params = meetingId ? `?meeting_id=${meetingId}` : "";
const response = await fetch(withBasePath(`/api/vexa/transcripts/${platform}/${nativeId}${params}`));
const transcriptPath = meetingId
? `/api/vexa/transcripts/by-id/${encodeURIComponent(meetingId)}`
: `/api/vexa/transcripts/${platform}/${nativeId}`;
const response = await fetch(withBasePath(transcriptPath));
interface RawSegment {
start: number;
end: number;
Expand Down
46 changes: 46 additions & 0 deletions services/dashboard/tests/test_transcript_meeting_id_api.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { afterEach, describe, expect, it, vi } from "vitest";
import { vexaAPI } from "@/lib/api";

function transcriptResponse(id: number) {
return {
ok: true,
json: async () => ({
id,
platform: "zoom",
native_meeting_id: "89237402037",
status: "active",
start_time: "2026-07-23T19:31:00Z",
end_time: null,
segments: [],
}),
};
}

describe("vexaAPI.getMeetingWithTranscripts", () => {
afterEach(() => {
vi.restoreAllMocks();
});

it("uses the exact meeting-row endpoint when an internal meeting id is supplied", async () => {
vi.stubGlobal("fetch", vi.fn().mockResolvedValue(transcriptResponse(13614)));

const result = await vexaAPI.getMeetingWithTranscripts(
"zoom",
"89237402037",
"13614"
);

expect(fetch).toHaveBeenCalledWith("/api/vexa/transcripts/by-id/13614");
expect(result.meeting.id).toBe("13614");
});

it("retains native-id lookup when no internal meeting id is supplied", async () => {
vi.stubGlobal("fetch", vi.fn().mockResolvedValue(transcriptResponse(13616)));

await vexaAPI.getMeetingWithTranscripts("zoom", "89237402037");

expect(fetch).toHaveBeenCalledWith(
"/api/vexa/transcripts/zoom/89237402037"
);
});
});
Loading