#5 Repos are now displayed on the webpage - Additional stlying required.
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
import type { GitRepo } from "../types";
|
||||
|
||||
const API_BASE_URL = "https://git.luke-else.co.uk/api/v1";
|
||||
// const ACCESS_TOKEN = import.meta.env.VITE_GITEA_TOKEN;
|
||||
|
||||
|
||||
export async function fetchRepos(): Promise<GitRepo[]> {
|
||||
try {
|
||||
console.log("Fetching repos...");
|
||||
const response = await fetch(`${API_BASE_URL}/repos/search`, {
|
||||
const response = await fetch(`${API_BASE_URL}/repos/search?sort=updated&order=desc&limit=12`, {
|
||||
headers: {
|
||||
// "Authorization": `token ${ACCESS_TOKEN}`,
|
||||
"Content-Type": "application/json"
|
||||
|
@ -1,8 +1,9 @@
|
||||
export interface GitRepo {
|
||||
id: number;
|
||||
name: string;
|
||||
full_name: string;
|
||||
description: string;
|
||||
language: string;
|
||||
size: number;
|
||||
updated_at: Date;
|
||||
html_url: string;
|
||||
private: boolean;
|
||||
fork: boolean;
|
||||
|
Reference in New Issue
Block a user