Skip to content

Commit

Permalink
imp: Improve performance to get public links of a user
Browse files Browse the repository at this point in the history
  • Loading branch information
marienfressinaud committed Oct 3, 2024
1 parent b22dd64 commit 28eac3b
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion src/controllers/Bookmarks.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public function index(Request $request): Response
[
'offset' => $pagination->currentOffset(),
'limit' => $pagination->numberPerPage(),
'context_user_id' => $user->id,
]
),
'pagination' => $pagination,
Expand Down
2 changes: 0 additions & 2 deletions src/controllers/Collections.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ public function show(Request $request): Response
[
'offset' => $pagination->currentOffset(),
'limit' => $pagination->numberPerPage(),
'context_user_id' => $user->id,
]
),
'pagination' => $pagination,
Expand All @@ -211,7 +210,6 @@ public function show(Request $request): Response
'hidden' => $access_is_shared,
'offset' => $pagination->currentOffset(),
'limit' => $pagination->numberPerPage(),
'context_user_id' => $user ? $user->id : '',
]
),
'pagination' => $pagination,
Expand Down
1 change: 0 additions & 1 deletion src/controllers/Profiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public function show(Request $request): Response
$links = $user->links(['published_at', 'number_comments'], [
'unshared' => false,
'limit' => 6,
'context_user_id' => $current_user ? $current_user->id : null,
]);

$collections = $user->collections(['number_links'], [
Expand Down
1 change: 0 additions & 1 deletion src/controllers/Read.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public function index(Request $request): Response
[
'offset' => $pagination->currentOffset(),
'limit' => $pagination->numberPerPage(),
'context_user_id' => $user->id,
]
);

Expand Down
1 change: 1 addition & 0 deletions src/models/dao/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ public static function listComputedByUserId(
INNER JOIN collections c
ON lc.collection_id = c.id
AND c.is_public = true
AND c.user_id = :user_id
SQL;

if (in_array('published_at', $selected_computed_props)) {
Expand Down

0 comments on commit 28eac3b

Please sign in to comment.