Skip to content

Commit 1de6d8c

Browse files
committed
revert: keep as old
1 parent d1d0173 commit 1de6d8c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/BaseService.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ class BaseService {
8484
put<T>(id: string | number, payload?: any, config?: AxiosRequestConfig) {
8585
const parameter = id && !isObject(id) ? `/${id}` : ''
8686
const body = isObject(id) ? id : payload
87-
return this.submit<T>('put', parameter, body, config)
87+
const requestType: Method = hasFiles(body) ? 'post' : 'put'
88+
if (hasFiles(body)) {
89+
Object.assign(body, { _method: 'put' })
90+
}
91+
return this.submit<T>(requestType, parameter, body, config)
8892
}
8993

9094
patch<T>(payload: any): Promise<T>

0 commit comments

Comments
 (0)