Skip to content

Commit

Permalink
Fixed api route for download file and view raw file
Browse files Browse the repository at this point in the history
  • Loading branch information
vivek-harness committed Jan 15, 2025
1 parent a7cc5cc commit a8cc11b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/gitness/src/components-v2/file-content-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function FileContentViewer({ repoContent }: FileContentViewerProp
const parentPath = fullResourcePath?.split(FILE_SEPERATOR).slice(0, -1).join(FILE_SEPERATOR)
const downloadFile = useDownloadRawFile()
const navigate = useNavigate()
const rawURL = `/api/v1/repos/${repoRef}/raw/${fullResourcePath}?git_ref=${fullGitRef}`
const rawURL = `/code/api/v1/repos/${repoRef}/raw/${fullResourcePath}?git_ref=${fullGitRef}`
const [view, setView] = useState<ViewTypeValue>(getDefaultView(language))
const [isDeleteFileDialogOpen, setIsDeleteFileDialogOpen] = useState(false)
const { selectedBranchTag } = useRepoBranchesStore()
Expand Down
2 changes: 1 addition & 1 deletion apps/gitness/src/framework/hooks/useDownloadRawFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface UseDownloadRawFileParams {

export function useDownloadRawFile() {
const mutation = useMutation(async ({ repoRef, resourcePath, gitRef }: UseDownloadRawFileParams) => {
const url = `/api/v1/repos/${repoRef}/raw/${resourcePath}?git_ref=${gitRef ?? ''}`
const url = `/code/api/v1/repos/${repoRef}/raw/${resourcePath}?git_ref=${gitRef ?? ''}`

const response = await fetch(url)
if (!response.ok) {
Expand Down

0 comments on commit a8cc11b

Please sign in to comment.