Fix bug in category endpoint & stats command
This commit is contained in:
parent
f84eef5e5f
commit
fa36795dde
@ -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,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -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",
|
||||||
|
Loading…
Reference in New Issue
Block a user