Files
bot-whatsapp/packages/docs/src/services/github.ts
Leifer Mendez 98793d0cfc fix(bot): 📝 more docs
2023-01-16 17:32:09 +01:00

23 lines
604 B
TypeScript

/**
* GET API from Github
* @returns
*/
export const fetchGithub = async (token: string) => {
const data = await fetch(
`https://api.github.com/repos/codigoencasa/bot-whatsapp/contributors`,
{
method: 'GET',
headers: {
Accept: 'application/vnd.github+json',
'X-GitHub-Api-Version': '2022-11-28',
Authorization: `Bearer ${token}`,
},
}
)
const listUsers = await data.json()
return listUsers.map((u: any) => ({
...u,
avatar_url: `${u.avatar_url}&s=80`,
}))
}