Skip to content

Commit

Permalink
chore: add back file info for opening
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan committed Dec 19, 2024
1 parent 194a9ba commit b84d4df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion web/hooks/usePath.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { openFileExplorer, joinPath, baseName, fs } from '@janhq/core'
import { openFileExplorer, joinPath, baseName } from '@janhq/core'
import { useAtomValue } from 'jotai'

import { getFileInfo } from '@/utils/file'
Expand Down
9 changes: 9 additions & 0 deletions web/utils/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,12 @@ export const uploader = () => {
})
return uppy
}

/**
* Get the file information from the server.
*/
export const getFileInfo = (id: string) => {
return fetch(`${API_BASE_URL}/v1/files/${id}`)
.then((e) => e.json())
.catch(() => undefined)
}

0 comments on commit b84d4df

Please sign in to comment.