Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in / Register
Toggle navigation
D
danbooru
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Repos Mirror
danbooru
Commits
da34c95d
Commit
da34c95d
authored
May 22, 2018
by
Albert Yi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add expiry parameter
parent
72d72fd3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
9 deletions
+12
-9
app/assets/javascripts/autocomplete.js.erb
app/assets/javascripts/autocomplete.js.erb
+6
-3
app/controllers/artists_controller.rb
app/controllers/artists_controller.rb
+2
-2
app/controllers/pools_controller.rb
app/controllers/pools_controller.rb
+1
-1
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+2
-2
app/controllers/wiki_pages_controller.rb
app/controllers/wiki_pages_controller.rb
+1
-1
No files found.
app/assets/javascripts/autocomplete.js.erb
View file @
da34c95d
...
...
@@ -194,7 +194,8 @@
"search[name]": req.term + "*",
"search[is_active]": true,
"search[order]": "post_count",
"limit": 10
"limit": 10,
"expiry": 7
},
method: "get",
success: function(data) {
...
...
@@ -235,7 +236,8 @@
"search[title]": req.term + "*",
"search[hide_deleted]": "Yes",
"search[order]": "post_count",
"limit": 10
"limit": 10,
"expiry": 7
},
method: "get",
success: function(data) {
...
...
@@ -259,7 +261,8 @@
$.ajax({
url: "/tags/autocomplete.json",
data: {
"search[name_matches]": term
"search[name_matches]": term,
"expiry": 7
},
method: "get",
success: function(data) {
...
...
app/controllers/artists_controller.rb
View file @
da34c95d
...
...
@@ -44,7 +44,7 @@ class ArtistsController < ApplicationController
end
format
.
json
do
render
:json
=>
@artists
.
to_json
(
:include
=>
[
:urls
])
expires_in
7
.
days
expires_in
params
[
:expiry
].
to_i
.
days
if
params
[
:expiry
]
end
end
end
...
...
@@ -109,7 +109,7 @@ class ArtistsController < ApplicationController
end
format
.
json
do
render
:json
=>
@artists
.
to_json
(
:include
=>
[
:sorted_urls
])
expires_in
7
.
days
expires_in
params
[
:expiry
].
to_i
.
days
if
params
[
:expiry
]
end
end
end
...
...
app/controllers/pools_controller.rb
View file @
da34c95d
...
...
@@ -24,7 +24,7 @@ class PoolsController < ApplicationController
end
format
.
json
do
render
json:
@pool
.
to_json
expires_in
7
.
days
expires_in
params
[
:expiry
].
to_i
.
days
if
params
[
:expiry
]
end
end
end
...
...
app/controllers/users_controller.rb
View file @
da34c95d
...
...
@@ -28,8 +28,8 @@ class UsersController < ApplicationController
render
:xml
=>
@users
.
to_xml
(
:root
=>
"users"
)
end
format
.
json
do
render
json:
@user
.
to_json
expires_in
7
.
days
render
json:
@user
s
.
to_json
expires_in
params
[
:expiry
].
to_i
.
days
if
params
[
:expiry
]
end
end
end
...
...
app/controllers/wiki_pages_controller.rb
View file @
da34c95d
...
...
@@ -31,7 +31,7 @@ class WikiPagesController < ApplicationController
end
format
.
json
do
render
json:
@wiki_pages
.
to_json
expires_in
7
.
days
expires_in
params
[
:expiry
].
to_i
.
days
if
params
[
:expiry
]
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment