Rewrite tagging UI with suggestions (#146)

This commit is contained in:
Alex Ling
2021-01-14 13:08:50 +00:00
parent 5abf7032a5
commit 1065b430e3
5 changed files with 137 additions and 51 deletions

View File

@@ -713,6 +713,24 @@ struct APIRouter
end
end
Koa.describe "Returns all tags"
Koa.response 200, ref: "$tagsResult"
get "/api/tags" do |env|
begin
tags = Storage.default.list_tags
send_json env, {
"success" => true,
"tags" => tags,
}.to_json
rescue e
Logger.error e
send_json env, {
"success" => false,
"error" => e.message,
}.to_json
end
end
Koa.describe "Adds a new tag to a title"
Koa.path "tid", desc: "A title ID"
Koa.response 200, ref: "$result"