mirror of
https://github.com/graphql-hive/console
synced 2026-05-15 21:29:43 +00:00
22 lines
513 B
TypeScript
22 lines
513 B
TypeScript
import * as utils from '@n1ru4l/dockest/test-helper';
|
|
import { fetch } from '@whatwg-node/fetch';
|
|
|
|
const emailsAddress = utils.getServiceAddress('emails', 3011);
|
|
|
|
export interface Email {
|
|
to: string;
|
|
subject: string;
|
|
body: string;
|
|
}
|
|
|
|
export async function history(): Promise<Email[]> {
|
|
const response = await fetch(`http://${emailsAddress}/_history`, {
|
|
method: 'GET',
|
|
headers: {
|
|
accept: 'application/json',
|
|
'content-type': 'application/json',
|
|
},
|
|
});
|
|
|
|
return response.json();
|
|
}
|