Skip to content
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 revert functionality#22xdxhp #22

Merged
merged 8 commits into from
Mar 30, 2022
Prev Previous commit
Next Next commit
Updated logic to revert changes(#22xdxhp)
disha1202 committed Mar 28, 2022
commit 42d20bd84ebcb1919b6a1180d18c703805a3d67c
5 changes: 2 additions & 3 deletions src/views/OrderDetail.vue
Original file line number Diff line number Diff line change
@@ -198,12 +198,10 @@ export default defineComponent({
facilities: [] as any,
queryString: "",
searchedProduct: {} as any,
original: [] as any
}
},
mounted(){
this.fetchFacilities();
this.original = JSON.parse(JSON.stringify(this.ordersList.original));
},
methods: {
async navigateBack(){
@@ -332,7 +330,8 @@ export default defineComponent({
item.isSelected = event.detail.checked;
},
revertAllChanges() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
revertAllChanges() {
revertAll() {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the requested change.

this.store.dispatch('order/updatedOrderListItems', this.ordersList.original);
const original = JSON.parse(JSON.stringify(this.ordersList.original));
this.store.dispatch('order/updatedOrderListItems', original);
},
apply() {
this.ordersList.items.map((item: any) => {