Skip to content

Commit ac6de20

Browse files
zxhlyhNov1c444
authored andcommitted
fix: webapp upload file (#10195)
1 parent 6100f77 commit ac6de20

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

web/app/components/base/file-uploader/hooks.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export const useFile = (fileConfig: FileUpload) => {
216216
handleAddFile(uploadingFile)
217217
startProgressTimer(uploadingFile.id)
218218

219-
uploadRemoteFileInfo(url).then((res) => {
219+
uploadRemoteFileInfo(url, !!params.token).then((res) => {
220220
const newFile = {
221221
...uploadingFile,
222222
type: res.mime_type,

web/service/common.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ export const verifyForgotPasswordToken: Fetcher<CommonResponse & { is_valid: boo
324324
export const changePasswordWithToken: Fetcher<CommonResponse, { url: string; body: { token: string; new_password: string; password_confirm: string } }> = ({ url, body }) =>
325325
post<CommonResponse>(url, { body })
326326

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

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

0 commit comments

Comments
 (0)