Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
fix: the internal server on load more and implement archive filter in…
Browse files Browse the repository at this point in the history
… query (#266)
  • Loading branch information
tbhaxor authored Jan 12, 2023
1 parent 79f86e6 commit 48529ee
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export declare type Repository = {
name: string;
url: string;
owner: Owner;
isArchived: boolean;
primaryLanguage: PrimaryLanguage;
codeOfConduct: CodeOfConduct;
licenseInfo: LicenseInfo;
Expand Down
5 changes: 3 additions & 2 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
import { goto } from '$app/navigation';
export let data: { data: SearchResponse; checked: boolean };
const globalQuery = 'is:open label:"EddieHub:good-first-issue" no:assignee';
const orgQuery = 'is:open label:"good first issue" org:EddieHubCommunity no:assignee';
const globalQuery = 'is:open archived:false label:"EddieHub:good-first-issue" no:assignee';
const orgQuery =
'is:open archived:false label:"good first issue" org:EddieHubCommunity no:assignee';
let { checked } = data;
let loadDisabled = false;
Expand Down
5 changes: 3 additions & 2 deletions src/routes/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ export const load: Load = async ({ fetch, url, parent }) => {
throw redirect(307, '/login');
}
let globalParam = false;
const globalQuery = 'is:open label:"EddieHub:good-first-issue" no:assignee';
const orgQuery = 'is:open label:"good first issue" org:EddieHubCommunity no:assignee';
const globalQuery = 'is:open archived:false label:"EddieHub:good-first-issue" no:assignee';
const orgQuery =
'is:open archived:false label:"good first issue" org:EddieHubCommunity no:assignee';

try {
globalParam = JSON.parse(url.searchParams.get('global') as string);
Expand Down
7 changes: 1 addition & 6 deletions src/routes/api/get-issues/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const POST: RequestHandler = async ({ request }) => {
const body = (await request.json()) as { query: string; after?: string };

const octokit = new Octokit({ auth: token });
let { search }: Response = await octokit.graphql(
const { search }: Response = await octokit.graphql(
`query EddieHubIssues($queryString: String!, $skip: Int!, $after: String) {
search(first: $skip, query: $queryString, type: ISSUE, after: $after) {
issueCount
Expand All @@ -43,7 +43,6 @@ export const POST: RequestHandler = async ({ request }) => {
repository {
name
url
isArchived
primaryLanguage {
color
name
Expand Down Expand Up @@ -74,10 +73,6 @@ export const POST: RequestHandler = async ({ request }) => {
after: body.after,
},
);

// filter out archived (read-only) repositories
search = { ...search, edges: search.edges.filter((edge) => !edge.node.repository.isArchived) };

const labels = search.edges.map((el) => el.node.labels.edges.map((label) => label.node.name));
const merged = labels.reduce((acc, val) => {
return acc.concat(val);
Expand Down
1 change: 0 additions & 1 deletion src/stories/issue-card.story.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
repository: {
name: 'LinkFree',
url: 'https://github.com/EddieHubCommunity/LinkFree',
isArchived: false,
primaryLanguage: {
color: '#f1e05a',
name: 'JavaScript',
Expand Down

0 comments on commit 48529ee

Please sign in to comment.