Skip to content

Commit

Permalink
Merge pull request #270 from ymaheshwari1/#267
Browse files Browse the repository at this point in the history
Fixed: duplicate toast message on file upload(#267)
  • Loading branch information
ymaheshwari1 authored Mar 18, 2024
2 parents b740b23 + 37311cc commit 9a1ea91
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/mixins/parseFileMixin.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
import { translate } from "@/i18n";
import store from "@/store";
import { showToast, parseCsv } from "@/utils";
import { parseCsv } from "@/utils";

export default {
methods: {
async parseCsv(file: any) {
if (file) {
store.dispatch('order/updateFileName', file.name);
const csvData = await parseCsv(file).then( res => {
return res;
})
showToast(translate("File uploaded successfully"));
return csvData;
}
showToast(translate("Something went wrong, Please try again"));
store.dispatch('order/updateFileName', file.name);
return await parseCsv(file).then(res => res)
}
}
}

0 comments on commit 9a1ea91

Please sign in to comment.