mirror of
https://github.com/discourse/discourse.git
synced 2025-03-23 10:45:41 +08:00
FIX: makes report description optional
This commit is contained in:
parent
83255d94d9
commit
34dbb32df4
@ -35,12 +35,14 @@ class Report
|
|||||||
end
|
end
|
||||||
|
|
||||||
def as_json(options = nil)
|
def as_json(options = nil)
|
||||||
|
description = I18n.t("reports.#{type}.description", default: "")
|
||||||
|
|
||||||
{
|
{
|
||||||
type: type,
|
type: type,
|
||||||
title: I18n.t("reports.#{type}.title"),
|
title: I18n.t("reports.#{type}.title"),
|
||||||
xaxis: I18n.t("reports.#{type}.xaxis"),
|
xaxis: I18n.t("reports.#{type}.xaxis"),
|
||||||
yaxis: I18n.t("reports.#{type}.yaxis"),
|
yaxis: I18n.t("reports.#{type}.yaxis"),
|
||||||
description: I18n.t("reports.#{type}.description"),
|
description: description.presence ? description : nil,
|
||||||
data: data,
|
data: data,
|
||||||
start_date: start_date&.iso8601,
|
start_date: start_date&.iso8601,
|
||||||
end_date: end_date&.iso8601,
|
end_date: end_date&.iso8601,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user