Charcoal-SE / metasmoke

Web dashboard for SmokeDetector.
https://metasmoke.erwaysoftware.com
Creative Commons Zero v1.0 Universal
43 stars 34 forks source link

API filter generator doesn't know about posts.reason_weight #227

Closed tripleee closed 7 years ago

tripleee commented 7 years ago

The one field I really want to query for is not visible here:

https://metasmoke.erwaysoftware.com/api/filters

Shouldn't the page be dynamically generated from the schema anyway?

ArtOfCode- commented 7 years ago

posts.reason_weight doesn't exist. You're thinking of SUM(reasons.weight) - you can either use posts-by-URL to get it, or query for a post's reasons and sum the weights.

tripleee commented 7 years ago

But https://github.com/Charcoal-SE/metasmoke/wiki/Posts-by-ID returns a field like that? Oh well, maybe close this. Thanks for the pointer.

ArtOfCode- commented 7 years ago

Posts by ID might have it as well. By URL definitely uses a jbuilder view, where we do the SUM(reasons.weight) automatically and include it; by ID might use the same view.