Skip to content

Commit

Permalink
add userLogin and tokenQuery in deleteworkflow and loadworkflow
Browse files Browse the repository at this point in the history
  • Loading branch information
qbc2016 committed Aug 9, 2024
1 parent 31e5c3d commit 278acfd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/agentscope/studio/static/js/workstation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1935,7 +1935,7 @@ function showLoadWorkflowPopup(userLogin, tokenQuery) {
}
}).then(result => {
if (result.isConfirmed) {
loadWorkflow(selectedFilename);
loadWorkflow(selectedFilename, userLogin, tokenQuery);
} else if (result.isDenied) {
Swal.fire({
title: `Are you sure to delete ${selectedFilename}?`,
Expand All @@ -1948,7 +1948,7 @@ function showLoadWorkflowPopup(userLogin, tokenQuery) {
cancelButtonText: 'Cancel'
}).then((deleteResult) => {
if (deleteResult.isConfirmed) {
deleteWorkflow(selectedFilename);
deleteWorkflow(selectedFilename, userLogin, tokenQuery);
}
});
}
Expand Down Expand Up @@ -1987,14 +1987,16 @@ function loadWorkflow(fileName, userLogin, tokenQuery) {
});
}

function deleteWorkflow(fileName) {
function deleteWorkflow(fileName, userLogin, tokenQuery) {
fetch('/delete-workflow', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
filename: fileName
filename: fileName,
user_login: userLogin,
token_query: tokenQuery,
})
}).then(response => response.json())
.then(data => {
Expand Down

0 comments on commit 278acfd

Please sign in to comment.