feat: get all links clicks join

This commit is contained in:
Juan Rodriguez
2024-07-12 07:58:21 +02:00
parent ebc9c6852e
commit a2aa586dae
4 changed files with 26 additions and 1 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ module App::Controllers::Link
user = env.get("user").as(User)
query = Database::Query.where(user_id: user.id.as(String))
links = Database.all(Link, query)
links = Database.all(Link, query, preload: [:clicks])
response = {"data" => links.map { |link| App::Serializers::Link.new(link) }}
response.to_json