Click here to Skip to main content
15,791,771 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: I am using javascript to convert a large table to a pdf Pin
RickyJudith8-Feb-23 1:24
RickyJudith8-Feb-23 1:24 
QuestionI have problem importing images of Json File on HTML Table Pin
Member 1590151922-Jan-23 3:14
Member 1590151922-Jan-23 3:14 
AnswerRe: I have problem importing images of Json File on HTML Table Pin
Jeremy Falcon24-Jan-23 5:30
professionalJeremy Falcon24-Jan-23 5:30 
Questionsoftware access control Pin
Member 1589900419-Jan-23 1:51
Member 1589900419-Jan-23 1:51 
AnswerRe: software access control Pin
Richard Deeming19-Jan-23 2:25
mveRichard Deeming19-Jan-23 2:25 
QuestionUse async function to retrieve data while looping through from another function to insert objects Pin
Member 1589206712-Jan-23 0:35
Member 1589206712-Jan-23 0:35 
AnswerRe: Use async function to retrieve data while looping through from another function to insert objects Pin
Richard Deeming12-Jan-23 1:02
mveRichard Deeming12-Jan-23 1:02 
QuestionRe: Use async function to retrieve data while looping through from another function to insert objects Pin
Member 1589206712-Jan-23 2:38
Member 1589206712-Jan-23 2:38 
Thank you very very much! That works perfectly!
But apparently, on postman the data I receive is good, but on frontend the action object inside data is empty and it shouldn't be.

This is what I get with postman:

{
    "data": [
        {
            "id": 2,
            "user_id": 1,
            "text": "d2222222",
            "posted_at": "1/12/2023 1:52:27 PM",
            "likes": 1,
            "comments": 0,
            "picture": "",
            "userid": 1,
            "name": "Gilbert",
            "actions": [
                {
                    "id": 1,
                    "tweet_id": 2,
                    "user_id": 1,
                    "liked": 1,
                    "retweeted": 0,
                    "replied_count": 0
                }
            ]
        }
    ]
}


And on frontend (Reactjs):
{
    "data": [
        {
            "id": 2,
            "user_id": 1,
            "text": "d2222222",
            "posted_at": "1/12/2023 1:52:27 PM",
            "likes": 1,
            "comments": 0,
            "picture": "",
            "userid": 1,
            "name": "Gilbert",
            "actions": []
        }
    ]
}


useEffect(() => {
        loadAllPosts();
    }, [])

    function loadAllPosts() {
        Axios.post('/api/loadposts', {
            userID: loginData.id
        }).then((response) => {
            console.log(response.data.data)
            setPosts(response.data.data);
        }).catch((error) => {
            console.log("Something went wrong.. We are investigating.");
        })
    }


modified 12-Jan-23 8:36am.

AnswerRe: Use async function to retrieve data while looping through from another function to insert objects Pin
Richard Deeming12-Jan-23 3:31
mveRichard Deeming12-Jan-23 3:31 
PraiseRe: Use async function to retrieve data while looping through from another function to insert objects Pin
Member 1589206712-Jan-23 4:17
Member 1589206712-Jan-23 4:17 
GeneralRe: Use async function to retrieve data while looping through from another function to insert objects Pin
Richard Deeming12-Jan-23 4:39
mveRichard Deeming12-Jan-23 4:39 
AnswerRe: Use async function to retrieve data while looping through from another function to insert objects Pin
Jeremy Falcon12-Jan-23 9:44
professionalJeremy Falcon12-Jan-23 9:44 
AnswerRe: Use async function to retrieve data while looping through from another function to insert objects Pin
Leon Scott Kennedy13-Jan-23 6:25
Leon Scott Kennedy13-Jan-23 6:25 
QuestionJava Script Pin
Prerna Kharbanda3-Jan-23 21:56
professionalPrerna Kharbanda3-Jan-23 21:56 
AnswerRe: Java Script Pin
Richard MacCutchan3-Jan-23 22:33
mveRichard MacCutchan3-Jan-23 22:33 
Questioncalendar validation Pin
Jithin P 202227-Dec-22 21:45
Jithin P 202227-Dec-22 21:45 
AnswerRe: calendar validation Pin
Dave Kreskowiak28-Dec-22 4:59
mveDave Kreskowiak28-Dec-22 4:59 
AnswerRe: calendar validation Pin
Jithin P 202229-Dec-22 4:31
Jithin P 202229-Dec-22 4:31 
AnswerRe: calendar validation Pin
Jeremy Falcon5-Jan-23 12:13
professionalJeremy Falcon5-Jan-23 12:13 
AnswerRe: calendar validation Pin
Jeremy Falcon5-Jan-23 12:17
professionalJeremy Falcon5-Jan-23 12:17 
Questionhow to modify cloned element draggable attribute ? Pin
VernonM23-Dec-22 11:37
VernonM23-Dec-22 11:37 
AnswerRe: how to modify cloned element draggable attribute ? Pin
VernonM23-Dec-22 15:57
VernonM23-Dec-22 15:57 
AnswerRe: how to modify cloned element draggable attribute ? Pin
VernonM24-Dec-22 3:43
VernonM24-Dec-22 3:43 
GeneralRe: how to modify cloned element draggable attribute ? Pin
VernonM25-Dec-22 4:51
VernonM25-Dec-22 4:51 
QuestionNeed Help with Drag n Drop... Pin
VernonM21-Dec-22 11:26
VernonM21-Dec-22 11:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.