0

Im on a find situacion because the result of the Parse.query is just the id and I had other columns :(

Response of find:

 [{"_objCount":0,"className":"DivorceCase","id":"8Ab15ASBX3"}]

Actual Code:

// Your corresponding keys
    Parse.initialize("xxx", "xxx");
// For back4app applications
    Parse.serverURL = 'https://parseapi.back4app.com'

var app = new Vue({
        el: "#AttorneyCases",
        data: {             
    DivorceCase :{},      
        },
  mounted:function(){
    new Parse.Query("DivorceCase").descending("createdAt").find()
    .then((DivorceCaseResponse) => {
      this.DivorceCase = DivorceCaseResponse;
    })
  }
  })
Roberto2790
  • 25
  • 1
  • 11

2 Answers2

2

to get the value of the other columns field, you need to use the code below:

var columnName = DivorceCaseResponse.get("columnName");

You can check more about retrieving objects here.

nataliec
  • 502
  • 4
  • 14
1

Thanks, nataliec!

The final code is:

mounted: function() {
    var Case = Parse.Object.extend("DivorceCase");
    var query = new Parse.Query(Case);
    query.find()
        .then((Ids) => {

                Ids.forEach(element => {

                    var Case = Parse.Object.extend("DivorceCase");
                    var query = new Parse.Query(Case);
                    query.get(element.id)
                        .then((DivorceCaseResponse) => {
                                // The object was retrieved successfully.
                                this.DivorceCases.push(DivorceCaseResponse.get("BasicInfo"));
                            },
                            (e) => {
                                // The object was not retrieved successfully.
                                // error is a Parse.Error with an error code and message.
                                swal({
                                    position: 'center',
                                    type: 'error',
                                    title: e.message,
                                    customClass: 'swal-wide'
                                })
                            });

                });



            },
            (e) => {
                // The object was not retrieved successfully.
                // error is a Parse.Error with an error code and message.
                swal({
                    position: 'center',
                    type: 'error',
                    title: e.message,
                    customClass: 'swal-wide'
                })

            });
}
Boken
  • 4,825
  • 10
  • 32
  • 42
Roberto2790
  • 25
  • 1
  • 11