fix: handle empty guesstimate descriptions

This commit is contained in:
Vyacheslav Matyukhin 2022-05-26 17:02:26 +04:00
parent 1e357a75b8
commit 19779bca02
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C

View File

@ -22,7 +22,7 @@ const modelToQuestion = (model: any): ReturnType<typeof prepareQuestion> => {
title: model.name,
url: `https://www.getguesstimate.com/models/${model.id}`,
// timestamp,
description,
description: description || "",
options: [],
qualityindicators: {
numforecasts: 1,
@ -90,5 +90,5 @@ export const guesstimate: Platform & {
search,
version: "v1",
fetchQuestion,
calculateStars: (q) => (q.description.length > 250 ? 2 : 1),
calculateStars: (q) => (q.description?.length > 250 ? 2 : 1),
};