From 6946e86a025a5729fea1d8b16ac8d1eccd8e89c5 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 6 Oct 2023 10:00:50 -0300 Subject: [PATCH] feat: reordenar usando los posts indexados --- app/services/post_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/post_service.rb b/app/services/post_service.rb index 4631a9a4..d59bc8c0 100644 --- a/app/services/post_service.rb +++ b/app/services/post_service.rb @@ -74,7 +74,7 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do # { uuid => 2, uuid => 1, uuid => 0 } def reorder reorder = params.require(:post).permit(reorder: {})&.dig(:reorder)&.transform_values(&:to_i) - posts = site.posts(lang: locale).where(uuid: reorder.keys) + posts = site.indexed_posts(locale: locale).where(post_id: reorder.keys).map(&:post) files = posts.map do |post| next unless post.attribute? :order