Skip to content

Commit

Permalink
fix: webapp upload file (#10195)
Browse files Browse the repository at this point in the history
  • Loading branch information
zxhlyh authored Nov 2, 2024
1 parent 0066531 commit dfa3ef0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/app/components/base/file-uploader/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export const useFile = (fileConfig: FileUpload) => {
handleAddFile(uploadingFile)
startProgressTimer(uploadingFile.id)

uploadRemoteFileInfo(url).then((res) => {
uploadRemoteFileInfo(url, !!params.token).then((res) => {
const newFile = {
...uploadingFile,
type: res.mime_type,
Expand Down
4 changes: 2 additions & 2 deletions web/service/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ export const verifyForgotPasswordToken: Fetcher<CommonResponse & { is_valid: boo
export const changePasswordWithToken: Fetcher<CommonResponse, { url: string; body: { token: string; new_password: string; password_confirm: string } }> = ({ url, body }) =>
post<CommonResponse>(url, { body })

export const uploadRemoteFileInfo = (url: string) => {
return post<{ id: string; name: string; size: number; mime_type: string; url: string }>('/remote-files/upload', { body: { url } })
export const uploadRemoteFileInfo = (url: string, isPublic?: boolean) => {
return post<{ id: string; name: string; size: number; mime_type: string; url: string }>('/remote-files/upload', { body: { url } }, { isPublicAPI: isPublic })
}

export const sendEMailLoginCode = (email: string, language = 'en-US') =>
Expand Down

0 comments on commit dfa3ef0

Please sign in to comment.