This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
81dfab9
commit 9975593
Showing
11 changed files
with
1,041 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_TOKEN=<Your-Super-Secret-Github-Token> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,6 @@ | |
}, | ||
"type": "module", | ||
"dependencies": { | ||
"cookie": "^0.4.1" | ||
"octokit": "^1.7.1" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { RequestHandler } from '@sveltejs/kit'; | ||
import { Octokit } from 'octokit'; | ||
|
||
export const get: RequestHandler = async () => { | ||
const token = import.meta.env.VITE_TOKEN; | ||
if (!token) return { status: 500, body: { message: 'please provide a token' } }; | ||
const octokit = new Octokit({ auth: token }); | ||
const response = await octokit.request('GET /search/issues', { | ||
q: 'is:issue is:open label:"good first issue" org:EddieHubCommunity no:assignee', | ||
}); | ||
return { | ||
status: 200, | ||
body: response.data, | ||
}; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,32 @@ | ||
<script lang="ts" context="module"> | ||
import type { Load } from '@sveltejs/kit'; | ||
import type { Item } from '../lib/types/github.type'; | ||
export const load: Load = async ({ session, fetch }) => { | ||
if (!session.token) { | ||
return { | ||
status: 302, | ||
redirect: 'auth', | ||
}; | ||
} | ||
const res = await fetch( | ||
'https://api.github.com/search/issues?q=is:issue%20is:open%20label:%22good%20first%20issue%22%20org:EddieHubCommunity%20no:assignee', | ||
{ | ||
headers: { | ||
Authorization: `token ${session.token}`, | ||
}, | ||
}, | ||
); | ||
const res = await fetch('/api/get-issues'); | ||
if (res.ok) { | ||
const data = await res.json(); | ||
return { | ||
props: { | ||
issues: data.items as Item[], | ||
data: data as IssueResponse, | ||
}, | ||
}; | ||
} | ||
const data = await res.json(); | ||
return { | ||
error: data.message, | ||
}; | ||
}; | ||
</script> | ||
|
||
<script lang="ts"> | ||
import IssueCard from '../lib/components/issue-card.svelte'; | ||
export let issues: Item[]; | ||
import type { IssueResponse } from '../lib/types/github.types'; | ||
export let data: IssueResponse; | ||
</script> | ||
|
||
<div class="space-y-4"> | ||
{#each issues as issue} | ||
{#each data.items as issue} | ||
<IssueCard {issue} /> | ||
{/each} | ||
</div> |
This file was deleted.
Oops, something went wrong.