mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Add a route to return used tags
This is part of the `/insights` route without queries for file usage.
This commit is contained in:
@ -31,11 +31,11 @@ trait Conversions {
|
||||
d.incoming,
|
||||
d.outgoing,
|
||||
d.bytes,
|
||||
TagCloud(d.tags.map(tc => TagCount(mkTagLight(tc), tc.count)))
|
||||
mkTagCloud(d.tags)
|
||||
)
|
||||
|
||||
def mkTagLight(t: OCollective.TagCount): TagLight =
|
||||
TagLight(t.id, t.name, t.category)
|
||||
def mkTagCloud(tags: List[OCollective.TagCount]) =
|
||||
TagCloud(tags.map(tc => TagCount(mkTag(tc.tag), tc.count)))
|
||||
|
||||
// attachment meta
|
||||
def mkAttachmentMeta(rm: RAttachmentMeta): AttachmentMeta =
|
||||
|
@ -28,6 +28,12 @@ object CollectiveRoutes {
|
||||
resp <- Ok(Conversions.mkItemInsights(ins))
|
||||
} yield resp
|
||||
|
||||
case GET -> Root / "cloud" =>
|
||||
for {
|
||||
cloud <- backend.collective.tagCloud(user.account.collective)
|
||||
resp <- Ok(Conversions.mkTagCloud(cloud))
|
||||
} yield resp
|
||||
|
||||
case req @ POST -> Root / "settings" =>
|
||||
for {
|
||||
settings <- req.as[CollectiveSettings]
|
||||
|
Reference in New Issue
Block a user