Remove redundant API_BASE constants and improve mobile UI layout

This commit is contained in:
Chris Scott committed 2025-11-27 11:42:37 -05:00
1 parent 6c88f23b5f
commit 07d78450be
6 files changed
+50 -51

No files matched your search

+2 -4
View File
@@ -2,10 +2,8 @@ import { useQuery } from '@tanstack/react-query'
import { API_BASE_URL } from '@/config'
import type { GitStatusResponse, FileDiffResponse } from '@/types/git'
const API_BASE = API_BASE_URL
export async function fetchGitStatus(repoId: number): Promise<GitStatusResponse> {
const response = await fetch(`${API_BASE}/api/repos/${repoId}/git/status`)
const response = await fetch(`${API_BASE_URL}/api/repos/${repoId}/git/status`)
if (!response.ok) {
const error = await response.json().catch(() => ({ error: 'Failed to fetch git status' }))
@@ -16,7 +14,7 @@ export async function fetchGitStatus(repoId: number): Promise<GitStatusResponse>
}
export async function fetchFileDiff(repoId: number, path: string): Promise<FileDiffResponse> {
const response = await fetch(`${API_BASE}/api/repos/${repoId}/git/diff?path=${encodeURIComponent(path)}`)
const response = await fetch(`${API_BASE_URL}/api/repos/${repoId}/git/diff?path=${encodeURIComponent(path)}`)
if (!response.ok) {
const error = await response.json().catch(() => ({ error: 'Failed to fetch file diff' }))