Last active
January 24, 2023 08:12
-
-
Save danLeBrown/b54986bb2f8dc5caddaadabca818a36b to your computer and use it in GitHub Desktop.
Revisions
-
danLeBrown revised this gist
Jan 24, 2023 . No changes.There are no files selected for viewing
-
danLeBrown revised this gist
Apr 24, 2021 . No changes.There are no files selected for viewing
-
danLeBrown created this gist
Apr 24, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ // this is where alert data from the server is stored const alertDataFromServer = [] // this is the message relayed to the user const messageToPush = [] // res.data.data (alert data) comes from the server alertDataFromServer.push(res.data.data) alertDataFromServer.forEach((element) => { const errorObjects = element.errors.errors Object.keys(errorObjects).forEach((key) => { obj[key].forEach((e) => { messageToPush.push({ message: e }) }) }) return true