Skip to content

Commit

Permalink
Implemented BE for PI Process import
Browse files Browse the repository at this point in the history
  • Loading branch information
TinCodes committed Sep 6, 2024
1 parent 5c8edd7 commit bdc2b29
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions resources/js/processes/import/components/ImportPIModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,33 @@ export default {
}
this.$root.file = this.file;
let formData = new FormData();
formData.append('file', this.file);
this.fileIsValid = true;
},
removeFile() {
this.file = '';
this.fileIsValid = false;
},
importNewPI() {}
importNewPI() {
console.log('> ', this.file);
if (!this.file) {
return;
}
let formData = new FormData();
formData.append('file', this.file);
ProcessMaker.apiClient
.post(`/package-ai/pi_process/import`, formData)
.then((response) => {
// TODO: Make import and redirect to Modeler
})
.catch((error) => {
window.ProcessMaker.alert(
this.$t("An error ocurred while importing the current PI Process."),
"danger",
);
});
}
},
computed: {
title() {
Expand Down

0 comments on commit bdc2b29

Please sign in to comment.