feat: add workflow pair

This commit is contained in:
karishmas6
2024-06-09 01:09:10 +05:30
parent f0629418ec
commit 1af5e4ce73

View File

@@ -45,3 +45,19 @@ export const deletePair = async(index: number): Promise<WorkflowFile> => {
}
};
export const AddPair = async(index: number, pair: WhereWhatPair): Promise<WorkflowFile> => {
try {
const response = await axios.post(`http://localhost:8080/workflow/pair/${index}`, {
pair,
}, {headers: {'Content-Type': 'application/json'}});
if (response.status === 200) {
return response.data;
} else {
throw new Error('Something went wrong when fetching an updated workflow');
}
} catch (error: any) {
console.log(error);
return emptyWorkflow;
}
};