//example URL: http://localhost:8080/?uid=1&nid=18&act=fund#/
//example URL: http://localhost:8080/?uid=1&nid=12&act=buy#/
(async () => {
function getUrlParam() {
let params = {};
let parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
params[key] = value;
});
return params;
}
let status = null,
actParam = getUrlParam()['act'];
if(actParam == 'buy#/') {
status = 1;
} else if(actParam == '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);
})