Fix bug in category endpoint & stats command

This commit is contained in:
Donovan Daniels 2024-06-29 02:14:37 -05:00
parent f84eef5e5f
commit fa36795dde
Signed by: Donovan_DMC
GPG Key ID: 907D29CBFD6157BA
2 changed files with 2 additions and 2 deletions

View File

@ -76,7 +76,7 @@ module YiffRest
render(json: { render(json: {
success: true, success: true,
data: { data: {
**APIImage.categories.find { |c| c[:db] == category }, **APIImage.categories.find { |c| c.db == category },
count: count, count: count,
}, },
}) })

View File

@ -325,7 +325,7 @@ class APIKey < ApplicationRecord
include WebhookMethods include WebhookMethods
def self.stats(ip: nil, key: nil) def self.stats(ip: nil, key: nil)
categories = APIImage.categories.pluck(:db) categories = APIImage.categories.map(&:db)
keys = [ keys = [
"yiffy2:stats:images:total", "yiffy2:stats:images:total",