Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
questionnaireRecord(result) {
if (result.data) {
this.questionnaireRec = result.data;
this.name = getFieldValue(this.questionnaireRec, QUESTIONNAIRE_NAME_FIELD);
// this.name = this.questionnaireRec.fields.Name.value;
this.description = getFieldValue(this.questionnaireRec, QUESTIONNAIRE_DESCRIPTION_FIELD);
// this.description = this.questionnaireRec.fields.Description__c.value;
this.status = this.questionnaire.questionnaireStatus;
this.setCardTheme();
this.setQuestionsAskedAndAnswered();
this.error = undefined;
} else if (result.error) {
this.error = result.error;
this.questionnaireRec = undefined;
}
}
questionnaireRecord(result) {
if (result.data) {
this.questionnaireRec = result.data;
this.name = getFieldValue(this.questionnaireRec, QUESTIONNAIRE_NAME_FIELD);
// this.name = this.questionnaireRec.fields.Name.value;
this.description = getFieldValue(this.questionnaireRec, QUESTIONNAIRE_DESCRIPTION_FIELD);
// this.description = this.questionnaireRec.fields.Description__c.value;
this.status = this.questionnaire.questionnaireStatus;
this.setCardTheme();
this.setQuestionsAskedAndAnswered();
this.error = undefined;
} else if (result.error) {
this.error = result.error;
this.questionnaireRec = undefined;
}
}
get city() {
return getFieldValue(this.property.data, CITY_FIELD);
}
wiredRecord({ error, data }) {
if (data) {
this.error = undefined;
this.dateListed = getFieldValue(data, DATE_LISTED_FIELD);
this.daysOnMarket = getFieldValue(data, DAYS_ON_MARKET_FIELD);
if (this.daysOnMarket < MAX_DAYS_NORMAL_STATUS) {
this.status = 'normal';
} else if (this.daysOnMarket < MAX_DAYS_WARNING_STATUS) {
this.status = 'warning';
} else {
this.status = 'alert';
}
} else if (error) {
this.daysOnMarket = undefined;
this.dateListed = undefined;
this.status = undefined;
this.error = error;
}
}
get pictureURL() {
return getFieldValue(this.property.data, PICTURE_FIELD);
}
get address() {
return getFieldValue(this.property.data, ADDRESS_FIELD);
}
get description() {
return getFieldValue(this.property.data, DESCRIPTION_FIELD);
}
get brokerId() {
return getFieldValue(this.property.data, BROKER_FIELD);
}
wiredRecord({ error, data }) {
if (data) {
this.error = undefined;
this.dateListed = getFieldValue(data, DATE_LISTED_FIELD);
this.daysOnMarket = getFieldValue(data, DAYS_ON_MARKET_FIELD);
if (this.daysOnMarket < MAX_DAYS_NORMAL_STATUS) {
this.status = 'normal';
} else if (this.daysOnMarket < MAX_DAYS_WARNING_STATUS) {
this.status = 'warning';
} else {
this.status = 'alert';
}
} else if (error) {
this.daysOnMarket = undefined;
this.dateListed = undefined;
this.status = undefined;
this.error = error;
}
}
get propertyName() {
return getFieldValue(this.property.data, NAME_FIELD);
}