console/integration-tests/testkit/emails.ts
Laurin Quast ec77725ca1
feat: persistent job queue with postgraphile worker (#7383)
Co-authored-by: jdolle <1841898+jdolle@users.noreply.github.com>
2026-01-12 13:13:23 +01:00

27 lines
607 B
TypeScript

import { getServiceHost } from './utils';
export interface Email {
to: string;
subject: string;
body: string;
}
export async function history(forEmail?: string): Promise<Email[]> {
const workflowsAddress = await getServiceHost('workflows', 3014);
const response = await fetch(`http://${workflowsAddress}/_history`, {
method: 'GET',
headers: {
accept: 'application/json',
'content-type': 'application/json',
},
});
const result: Email[] = await response.json();
if (!forEmail) {
return result;
}
return result.filter(result => result.to === forEmail);
}