Skip to content

Commit

Permalink
sorting on edit record
Browse files Browse the repository at this point in the history
  • Loading branch information
gilcohen67 committed Jul 1, 2022
1 parent df8016f commit 2c585f4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/RecordLibraryPage/EditModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ export default function EditModal({ setShowEditModal, row, setRow, tableData, se
},
})
.then(({ data }) => {
const setUserData = dataDecipher(data);
setUserProblemArray(setUserData[1]);
const userData = dataDecipher(data);
setUserProblemArray(
userData[1].sort((prompt1, prompt2) =>
prompt1.timeStamp.localeCompare(prompt2.timeStamp)
)
);
toast.success("Problem Changed", toastifyTheme);
handleExitModal();
})
Expand Down

0 comments on commit 2c585f4

Please sign in to comment.