Changeset 16798


Ignore:
Timestamp:
Oct 13, 2017, 7:29:22 PM (18 months ago)
Author:
adriano.campos
Message:

Add http POST example

Location:
internals/2017/FrontEndPlataformaSocial/Social_Plataform
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • internals/2017/FrontEndPlataformaSocial/Social_Plataform/.meteor/packages

    r16682 r16798  
    2626aldeed:autoform
    2727aldeed:collection2-core
     28http
  • internals/2017/FrontEndPlataformaSocial/Social_Plataform/client/scripts/Forms/User/Buy.js

    r16775 r16798  
    5454    label: "Property Use",
    5555    optional: true,
    56     allowedValues: ['Aveiro', 'Beja', 'Braga', 'Bragança', 'CasteloBranco',
    57     'Coimbra', 'Evora', 'Faro','Guarda','Leiria','Lisboa','Portalegre','Porto',
    58     'Santarem','Setubal', 'VianaCastelo'],
    5956    autoform: {
    6057      firstOption: "Choose the property use",
    6158      options: {
    62         Aveiro: "Residential Property",
    63         Beja: "Office property",
    64         Braga: "Retail property",
    65         CasteloBranco: "Recreational property",
    66         Coimbra: "Industrial property",
    67         Evora: "Hotel property",
    68         Faro: "Restaurant",
    69         Guarda: "Logistics property",
    70         Leiria: "Infrastructure property",
    71         Lisboa: "Public sector property",
    72         Portalegre: "Health and care property",
    73         Porto: "Data Centers & Telecommunications",
    74         Santarem: "Education",
    75         Setubal: "Energy and Resources",
    76         VianaCastelo: "Land"
     59        Residential: "Residential Property",
     60        Office: "Office property",
     61        Retail: "Retail property",
     62        Recreational: "Recreational property",
     63        Industrial: "Industrial property",
     64        Hotel: "Hotel property",
     65        Restaurant: "Restaurant",
     66        Logistics: "Logistics property",
     67        Infrastructure: "Infrastructure property",
     68        Public: "Public sector property",
     69        Health: "Health and care property",
     70        DataCenters: "Data Centers & Telecommunications",
     71        Education: "Education",
     72        Energy: "Energy and Resources",
     73        Land: "Land"
    7774      }
    7875    }
     
    113110    label: 'Property Type',
    114111    optional: true,
    115     allowedValues: ['Aveiro', 'Beja', 'Braga', 'Bragança', 'CasteloBranco'
    116     ],
     112    allowedValues: ['Single', 'Condo', 'CondoBuilding', 'MultiFamily'],
    117113    autoform: {
    118114      firstOption: "Choose the property type",
    119115      options: {
    120         Aveiro: "Single Family",
    121         Beja: "Condo",
    122         Braga: "Condo Building",
    123         CasteloBranco: "Multi Family"
     116        Single: "Single Family",
     117        Condo: "Condo",
     118        CondoBuilding: "Condo Building",
     119        MultiFamily: "Multi Family"
    124120      }
    125121    }
     
    176172  onSubmit: function() {
    177173      Router.go('privateUserProjects');
     174      var returnContractTypeNeed = AutoForm.getFieldValue("contractTypeNeed");
     175      var returnPropertyUse = AutoForm.getFieldValue("propertyUse");
     176      var returnProperty = AutoForm.getFieldValue("property");
     177      var returnLocal = AutoForm.getFieldValue("local");
     178      var returnPeople = AutoForm.getFieldValue("people");
     179      var returnNumB = AutoForm.getFieldValue("numB");
     180      var returnPrice = AutoForm.getFieldValue("price");
     181      var returnDescription = AutoForm.getFieldValue("description");
     182
     183      console.log("returnTripType: "+returnContractTypeNeed);
     184      var postData = [
     185        {
     186          "returnContractTypeNeed" : returnContractTypeNeed,
     187          "returnPropertyUse" : returnPropertyUse,
     188          "returnProperty" : returnProperty,
     189          "returnLocal" : returnLocal,
     190          "returnPeople" : returnPeople,
     191          "returnNumB" : returnNumB,
     192          "returnPrice" : returnPrice,
     193          "returnDescription" : returnDescription
     194        }
     195      ]
     196
     197      Meteor.http.call("POST","https://private-24a0f-relink.apiary-mock.com/RELinkProperty", {
     198                           data: postData
     199                       },function(error,result){
     200                           if(result.statusCode==200)
     201                           {
     202                               console.log(result.content);
     203                           }else{
     204                               console.log(result.content);
     205                           }
     206                       });
    178207      return false;
    179208    }
Note: See TracChangeset for help on using the changeset viewer.