mirror of
https://github.com/discourse/discourse.git
synced 2026-08-09 21:45:25 +08:00
<img width="667" height="325" alt="Screenshot 2026-07-28 at 11 57 10" src="https://github.com/user-attachments/assets/b58efdbb-7158-4c92-a83f-b1a484769993" /> <img width="538" height="347" alt="Screenshot 2026-07-28 at 11 57 22" src="https://github.com/user-attachments/assets/65ffbea6-8e7e-49cd-b49f-599b8a50b7da" />
27 lines
742 B
Ruby
Vendored
27 lines
742 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
module DiscourseTopicVoting
|
|
module Workflows
|
|
module Schema
|
|
VOTE_SCHEMA =
|
|
DiscourseWorkflows::Schema.entity(
|
|
"vote",
|
|
JSON.parse(<<~JSON),
|
|
{
|
|
"id": { "type": "integer" },
|
|
"count": { "type": "integer" },
|
|
"created_at": { "type": "string", "format": "date-time" }
|
|
}
|
|
JSON
|
|
"Vote that was cast, with the topic vote count once it was cast",
|
|
)
|
|
|
|
TOPIC_RECEIVED_VOTE_OUTPUT_SCHEMA =
|
|
DiscourseWorkflows::Schema.merge(
|
|
DiscourseWorkflows::Schema::TOPIC_LIST_ITEM_SCHEMA,
|
|
DiscourseWorkflows::Schema::USER_SCHEMA,
|
|
VOTE_SCHEMA,
|
|
).freeze
|
|
end
|
|
end
|
|
end
|