-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented logic to display toast for success/error after upload act… #15
Conversation
src/views/PurchaseOrder.vue
Outdated
@@ -65,6 +65,8 @@ import { defineComponent } from "vue"; | |||
import { useRouter } from 'vue-router'; | |||
import { parseCsv } from '@/utils'; | |||
import { useStore } from "vuex"; | |||
import { showToast } from '@/utils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { showToast } from '@/utils'; | |
import { showToast, parseCsv } from '@/utils'; |
and we can remove line 66.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the requested change.
showToast(translate("File uploaded successfully")); | ||
} | ||
else { | ||
showToast(translate("Something went wrong, Please try again")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add static text in translation file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added static text in translation file.
@@ -96,6 +98,12 @@ export default defineComponent({ | |||
methods: { | |||
getFile(event) { | |||
this.file = event.target.files[0]; | |||
if(this.file){ | |||
showToast(translate("File uploaded successfully")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move this.parseFile()
inside if
, as we only want to parse the file when we have it, otherwise not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the code.
…only selected products(2335ca9)
…ion(#2335ca9)