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