Skip to content

Commit

Permalink
Fix upload plugin (#383)
Browse files Browse the repository at this point in the history
* fix upload bug

* fix upload bug

* fix upload bug

---------

Co-authored-by: chenwk <chenwk@akulaku.com>
  • Loading branch information
misaya295 and chenwk authored Dec 20, 2023
1 parent 9744d1f commit 57011ed
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/services/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ export async function addPlugin(params) {
if(typeof params.file === 'string')
{
formData.append("file", params.file);
}else {
const base64Data = await readFileAsBase64(params.file);
formData.append("file", base64Data);
}
const base64Data = await readFileAsBase64(params.file);
formData.append("file", base64Data);
}
return request(`${baseUrl}/plugin`, {
method: `POST`,
Expand Down Expand Up @@ -230,10 +231,10 @@ export async function updatePlugin(params) {
if(typeof params.file === 'string')
{
formData.append("file", params.file);
}else {
const base64Data = await readFileAsBase64(params.file);
formData.append("file", base64Data);
}
const base64Data = await readFileAsBase64(params.file);
formData.append("file", base64Data);

}
return request(`${baseUrl}/plugin/${params.id}`, {

Expand Down

0 comments on commit 57011ed

Please sign in to comment.