dibas-np / E-challan-System

A collaboration project, E-Challan System, done with following Scrum methodology.
GNU General Public License v3.0
2 stars 3 forks source link

Can't update Challan #22

Closed Elizaphuyal closed 3 years ago

Elizaphuyal commented 3 years ago

Steps to reproduce

  1. Go to Admin login page
  2. Enter username and password to get logged in
  3. In Admin Page click "Edit" button to edit.
  4. Change the value of any input box
  5. Click Submit

Current behaviour The data isn't being updated. It is the same as it wasn't updated.

Expected behaviour Data should be updated in table.

Screenshots

image As can be seen above, it is same before and after updating data.

kingrabins commented 3 years ago

@dibas-np I also had same kind of issue when working with json server, so, I think I could help you on this. let me test the code and will get back to you with possible solution.

kingrabins commented 3 years ago

Problem

I think the page is being reloaded before the data is updated through update button.

Screenshots

image When you enter the submit button, the page gets reloaded because of its default reloading behaviour of form. And only after that button pop up is coming, so your data is not updated.

Possible Solutions

You can just change the Event Listner of submit button and use update button as its event trigger. Or you can just make update button as event listner for the updating action.

I hope this helps to fixing your bug.

dibas-np commented 3 years ago

Rabins, you are right. The problem was that the page was reloading before update function was being called. I am using SweetAlert popup for the update action. But when the value wasn't being passed inside SweetAlert popup (which didn't passed data to the update function as it was inside popup), Hence update didn't receive any value. I have make it so that popup is called inside update function.

dibas-np commented 3 years ago

@Elizaphuyal Please run the test again and let me know.

kingrabins commented 3 years ago

I test it and it is working as required. I filled the empty category and edited name value. It works fine now. image Updated image

Good job @dibas-np . Happy to see my tips worked to your issue to some extent. Lets wait for our BA to have say on this. good luck

Elizaphuyal commented 3 years ago

I ran the test again. Now everything is working as expected. Good Job!