Skip to content

Commit 618dd2b

Browse files
parth0025claude
andcommitted
fix: preserve dataType and options across JWT refresh retry (#38)
apiRequest and apiRequestWithoutCompnay reconstruct the call after a token refresh using only (type, endPoint, data), dropping dataType and options. Any retry of a multipart upload then runs through the JSON axios instance instead of the form-data instance, and any caller-supplied abort signal or per-request option is lost. Forwarded dataType and options into both retry calls so the replay matches the original. Closes #38 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 662715a commit 618dd2b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

frontend/src/services/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export const apiRequest = (type, endPoint, data, dataType, options) => {
184184
}else if (err?.response?.data?.isJwtError) {
185185
const userId = localStorage.getItem('userId') || "";
186186
await getAuth(userId);
187-
apiRequest(type, endPoint, data).then((sData)=>{
187+
apiRequest(type, endPoint, data, dataType, options).then((sData)=>{
188188
resolve(sData);
189189
}).catch((err) => {
190190
reject(err);
@@ -234,7 +234,7 @@ export const apiRequestWithoutCompnay = (type, endPoint, data, dataType,options)
234234
} else if (err?.response?.data?.isJwtError) {
235235
const userId = localStorage.getItem('userId') || "";
236236
await getAuth(userId);
237-
apiRequestWithoutCompnay(type, endPoint, data).then((sData)=>{
237+
apiRequestWithoutCompnay(type, endPoint, data, dataType, options).then((sData)=>{
238238
resolve(sData);
239239
}).catch((err) => {
240240
reject(err);

0 commit comments

Comments
 (0)