Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

JSON - Add status to JSON

0 votes
9 views
added Jul 5, 2018 in API by Grimloxx Second Warrant Officer (3,370 points)
edited Jul 13, 2018 by LC Marshal
// get list of units
(async () => {
let status = null;      
if(this.actionType === 'buy') {
  status = 1;
} else if(this.actionType === 'fund') {
  status = 2;
}

let apiUrl = `${mainSiteUrl}/api/property-units.json?property_nid=${this.pid}`;
if(status) apiUrl += `&status=${status}`;

const { data } = await this.axios.get(apiUrl);

this.setListOfUnits(data);
})();

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...