mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
Remove redundant API_BASE constants and improve mobile UI layout
This commit is contained in:
1 parent
6c88f23b5f
commit
07d78450be
6 files changed
+50
-51
No files matched your search
@@ -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' }))
|
||||
|
||||
Reference in new issue
Block a user