2022-12-28 09:37:23 +00:00
|
|
|
import { getServiceHost } from './utils';
|
2022-08-12 12:51:09 +00:00
|
|
|
|
|
|
|
|
export interface Email {
|
|
|
|
|
to: string;
|
|
|
|
|
subject: string;
|
|
|
|
|
body: string;
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-06 11:48:01 +00:00
|
|
|
export async function history(): Promise<Email[]> {
|
2022-12-28 09:37:23 +00:00
|
|
|
const emailsAddress = await getServiceHost('emails', 3011);
|
|
|
|
|
|
2022-10-06 11:48:01 +00:00
|
|
|
const response = await fetch(`http://${emailsAddress}/_history`, {
|
|
|
|
|
method: 'GET',
|
|
|
|
|
headers: {
|
|
|
|
|
accept: 'application/json',
|
|
|
|
|
'content-type': 'application/json',
|
|
|
|
|
},
|
2022-08-12 12:51:09 +00:00
|
|
|
});
|
|
|
|
|
|
2022-10-06 11:48:01 +00:00
|
|
|
return response.json();
|
2022-08-12 12:51:09 +00:00
|
|
|
}
|