MCPcopy Index your code
hub / github.com/fastapi/full-stack-fastapi-template / findEmail

Function findEmail

frontend/tests/utils/mailcatcher.ts:9–31  ·  view source on GitHub ↗
({
  request,
  filter,
}: {
  request: APIRequestContext
  filter?: (email: Email) => boolean
})

Source from the content-addressed store, hash-verified

7}
8
9async function findEmail({
10 request,
11 filter,
12}: {
13 request: APIRequestContext
14 filter?: (email: Email) => boolean
15}) {
16 const response = await request.get(`${process.env.MAILCATCHER_HOST}/messages`)
17
18 let emails = await response.json()
19
20 if (filter) {
21 emails = emails.filter(filter)
22 }
23
24 const email = emails[emails.length - 1]
25
26 if (email) {
27 return email as Email
28 }
29
30 return null
31}
32
33export function findLastEmail({
34 request,

Callers 1

checkEmailsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected