* Featured image hiding
This makes sure the Featured Image on the front page obeys user hiding.
* Optimized
Took the `hidden=1` check out of the `WHERE` clause.
* proper anti join
Co-authored-by: liamwhite <liamwhite@users.noreply.github.com>
This used to be allowed in the old searching with the `deleted` param for all users.
This should correctly add back the ability (using the new `del` param) to specify `del=1` for any user/API search, but correctly block them from doing the more specialized "staff only" searching.
* Fix for module placement
Correcting my own mistake when I first made these routes
* Correcting module location
* Correcting module location
* Fix
Fixes a potential crash when no posts are returned.
* Add route
`/api/v1/json/features`
Shows current featured image
* Add route
`/api/v1/json/features`
Shows current featured image.
* Removed binding
* Moving this file to a more appropriate name.
* Correctly named and placed
Correctly named and placed to match its module name
* Updated per review
* Changed as per review
Renamed to `PhilomenaWeb.Api.Json.FeaturedController`
Moved to `lib/philomena_web/controllers/api/json/featured_controller.ex`
* Updated route
Route `/api/v1/json/images/featured` now uses `PhilomenaWeb.Api.Json.FeaturedController`
* like this
Co-authored-by: liamwhite <liamwhite@users.noreply.github.com>
* Fix for distance
Fixes the `distance` to search not being passed through to `ImageReverse.images()`
`set_scraper_cache` passes the `distance` through into `params`
`create` normalizes and inserts the result into the params passed to `ImageReverse.images()`
`normalize_dist` checks if there is a `distance` set, adds a leading 0 to it (to account for values like `.5`, which would crash `Float.parse()`), and turns it back into a well-formatted string for `ImageReverse.images()`
* Fixed space
* Adding routes for /forums
Adding routes for new /forums endpoints
* New API Routes
`/forum`
`/forum/:forum_id`
* Add New API Routes
`/forums/:forum_id/topics/:topic_id/`
`/forums/:forum_id/topics/:topic_id/:post_id`
* Adds New API Routes
`/forums/:forum_id/topics`
`/forums/:forum_id/topics/:topic_id`
* Forum JSON formatter
* Updated
Correctly filters out things that should not be shown.
* Added topic JSON filter
* Added correct pagination
* Spacing and neatened
* Cleaned up
Consolidated queries and neatened up spacing.
Fixed name
* Removed unneeded aliases
* Cleaned up
Consolidated queries
Fixed spacing
Removed unneeded aliases
* Cleaned up
Spacing
* Cleaned up
spacing
* Depluralized
* Cleaned up
Removed space
* Removed extra spaces
* Removed extra spaces
* Removed extra spaces
* Removed preloads
* Cleaned up
Grouped clauses
* Consolodated further
* Cleaned up preloads
* Cleaned up
Preloads
consolidated clauses
grouped clauses
* Cleaned up
removed `id`
`locked`
* Removed topic_id
Not useful since the API client should already know it.
* More consolodation of terms
* Add total post count
* Removed unneeded variable
* Last cleanup, I swear.