mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2025-12-13 23:16:45 +03:00
tsc fixes
This commit is contained in:
@@ -131,6 +131,8 @@ export const repositorySchema = z.object({
|
||||
"skipped",
|
||||
"deleting",
|
||||
"deleted",
|
||||
"syncing",
|
||||
"synced",
|
||||
])
|
||||
.default("imported"),
|
||||
lastMirrored: z.coerce.date().optional().nullable(),
|
||||
@@ -157,6 +159,8 @@ export const mirrorJobSchema = z.object({
|
||||
"skipped",
|
||||
"deleting",
|
||||
"deleted",
|
||||
"syncing",
|
||||
"synced",
|
||||
])
|
||||
.default("imported"),
|
||||
message: z.string(),
|
||||
@@ -191,6 +195,8 @@ export const organizationSchema = z.object({
|
||||
"skipped",
|
||||
"deleting",
|
||||
"deleted",
|
||||
"syncing",
|
||||
"synced",
|
||||
])
|
||||
.default("imported"),
|
||||
lastMirrored: z.coerce.date().optional().nullable(),
|
||||
|
||||
@@ -194,7 +194,7 @@ export async function apiRequest<T>(
|
||||
}
|
||||
}
|
||||
|
||||
export const getStatusColor = (status: RepoStatus): string => {
|
||||
export const getStatusColor = (status: string): string => {
|
||||
switch (status) {
|
||||
case "imported":
|
||||
return "bg-blue-500"; // Info/primary-like
|
||||
@@ -208,6 +208,12 @@ export const getStatusColor = (status: RepoStatus): string => {
|
||||
return "bg-indigo-500"; // Sync in progress
|
||||
case "synced":
|
||||
return "bg-teal-500"; // Sync complete
|
||||
case "skipped":
|
||||
return "bg-gray-500"; // Skipped
|
||||
case "deleting":
|
||||
return "bg-orange-500"; // Deleting
|
||||
case "deleted":
|
||||
return "bg-gray-600"; // Deleted
|
||||
default:
|
||||
return "bg-gray-400"; // Unknown/neutral
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ export const POST: APIRoute = async ({ request }) => {
|
||||
// Fetch GitHub data in parallel
|
||||
const [basicAndForkedRepos, starredRepos, gitOrgs] = await Promise.all([
|
||||
getGithubRepositories({ octokit, config }),
|
||||
config.githubConfig?.mirrorStarred
|
||||
config.githubConfig?.includeStarred
|
||||
? getGithubStarredRepositories({ octokit, config })
|
||||
: Promise.resolve([]),
|
||||
getGithubOrganizations({ octokit, config }),
|
||||
|
||||
Reference in New Issue
Block a user