mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-18 11:39:15 +00:00
docs: ⚡ added contributors
This commit is contained in:
@@ -1,20 +1,23 @@
|
||||
import { component$, Resource, useResource$ } from '@builder.io/qwik'
|
||||
import Collaborator from './Collaborator'
|
||||
import { Octokit } from '@octokit/core'
|
||||
|
||||
export const octokit = new Octokit({
|
||||
auth: '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',
|
||||
})
|
||||
|
||||
export const apiGetCollaborators = () =>
|
||||
octokit.request(
|
||||
'GET /repos/codigoencasa/bot-whatsapp/contributors{?anon,per_page,page}',
|
||||
export const apiGetCollaborators = async () => {
|
||||
const data = fetch(
|
||||
`https://api.github.com/repos/codigoencasa/bot-whatsapp/contributors`,
|
||||
{
|
||||
owner: 'OWNER',
|
||||
repo: 'REPO',
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Accept: 'application/vnd.github+json',
|
||||
'X-GitHub-Api-Version': '2022-11-28',
|
||||
Authorization:
|
||||
'Bearer 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',
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
return (await data).json()
|
||||
}
|
||||
|
||||
export const TaleUsers = component$((props: { users: any[] }) => {
|
||||
return (
|
||||
<>
|
||||
@@ -30,7 +33,7 @@ export const TaleUsers = component$((props: { users: any[] }) => {
|
||||
|
||||
export default component$(() => {
|
||||
const collaboratorsResource = useResource$(
|
||||
async () => await (await apiGetCollaborators()).data
|
||||
async () => await apiGetCollaborators()
|
||||
)
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user