1 | import GhostAdminAPI from '@tryghost/admin-api' |
2 |
|
3 | type Ghostcms = { |
4 | apiKey: string |
5 | apiUrl: string |
6 | } |
7 |
|
8 | export async function main(resource: Ghostcms, email: string) { |
9 | const apiClient = new GhostAdminAPI({ |
10 | url: resource.apiUrl, |
11 | version: 'v5.87', |
12 | key: resource.apiKey |
13 | }) |
14 |
|
15 | const response = await apiClient.members.browse() |
16 |
|
17 | const filteredResponse = response.find((member) => member.email === email) |
18 |
|
19 | return filteredResponse |
20 | } |
21 |
|