Playing Next Lesson In
seconds

Let's Learn AdonisJS 6 #9.6

Persist Filters Easily with Lucid's Query String Method

In This Lesson

Learn how to simplify pagination by persisting active filters with the query string method. Follow this step-by-step guide to clean up your code, apply the .queryString method from Lucid, and ensure seamless pagination for your web applications.

Created by
@tomgobich
Published

00:00 - Current Pagination Approach

  • Explanation of current method: manually appending filters to pagination URLs

00:16 - Overlooked Method

  • Introduction to an overlooked method to simplify pagination

  • Removal of the query string module from Node.js

00:29 - Code Cleanup

  • Steps to remove the existing query string logic from the code

  • Cleaning up imports and looping mechanisms

00:51 - New Pagination Method

  • Introduction of the .queryString method from Lucid's simple paginator

  • Implementation of the new method to handle key-value pairs for pagination

01:08 - Applying Changes to Watchlists Controllers

  • Application of the new method to the watchlist controller

  • Removal of old query string code from the watchlist controller

01:26 - Movies Controller Updates

  • Repeating the process for the movies controller

  • Removal of old query string logic from the movies controller

01:45 - Updating Pages

  • Updating the movies index page to remove query string logic

  • Ensuring the new method is applied to all pagination links (first, previous, next, last)

02:15 - Validation and Testing

  • Checking for any remaining use of the query string

  • Validation that filters are correctly applied

  • Testing in the browser to ensure everything works correctly with the new method

02:48 - Logging In and Further Testing

  • Logging in to test user functionality

  • Applying filters and navigating through pages to confirm persistence of filters

Join the Discussion 0 comments

Create a free account to join in on the discussion
robot comment bubble

Be the first to comment!