Skip to content

Commit

Permalink
move type and remove unnecessary JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixTJDietrich committed Aug 13, 2024
1 parent fbe699b commit f691449
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
10 changes: 10 additions & 0 deletions webapp/src/app/@types/github.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export namespace GitHub {
export interface Contributor {
id: number;
login: string;
url: string;
html_url: string;
avatar_url: string;
// More fields can be added here
}
}
13 changes: 2 additions & 11 deletions webapp/src/app/about/about.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ import { AvatarComponent } from 'app/ui/avatar/avatar.component';
import { AvatarImageComponent } from 'app/ui/avatar/avatar-image.component';
import { AvatarFallbackComponent } from 'app/ui/avatar/avatar-fallback.component';
import { ButtonComponent } from 'app/ui/button/button.component';

interface Contributor {
id: number;
login: string;
url: string;
html_url: string;
avatar_url: string;
}
import { GitHub } from 'app/@types/github';

@Component({
selector: 'app-about',
Expand All @@ -26,7 +19,7 @@ export class AboutComponent {

query = injectQuery(() => ({
queryKey: ['contributors'],
queryFn: async () => lastValueFrom(this.http.get('https://api.github.com/repos/ls1intum/hephaestus/contributors')) as Promise<Contributor[]>,
queryFn: async () => lastValueFrom(this.http.get('https://api.github.com/repos/ls1intum/hephaestus/contributors')) as Promise<GitHub.Contributor[]>,
gcTime: Infinity
}));

Expand All @@ -46,6 +39,4 @@ export class AboutComponent {
}
return data.filter((contributor) => contributor.id !== 5898705);
});

JSON = JSON;
}

0 comments on commit f691449

Please sign in to comment.