⌛TIMELINE⏳ 0:00 Pagination Mistake Correction 0:16 How Pagination Should Work (Concept Explained) 2:10 Real Problem We Faced in Pagination 3:35 Fixing Pagination Issue (Code Implementation) 6:40 Testing the Fixed Pagination 7:05 Final Words + Next Step (VPS Deployment)
AI Generated·May contain errors
Hello what's up guys
Welcome back everyone to the next gist and my sequel's present job portal application
today marks my 96th day aam
and today I'm going to fix our pagination issue
yes guys so there's
a problem I'll explain it to you in yesterday's video
and when you go to the second page when you
go to the second page
and if you search here
let's say you wrote flower
as I wrote the flower here
then if I am writing flower
I've already fixed it and today in this video
I'll show you how you can do it yourself
because I was on the second page
but the moment I wrote "flower
" I'll return to the first page
and all my cards that were there
In this section wherever this
flower keyword appears I'm getting it
like those cards I'm receiving here
—this is where pagination comes in
e correct way on the internet is
no matter which page you go to
for example in my case it was
on page number 2 it was me
On page 2 you
see only
one card
Only one card is shown
and now if I write
here you'll think when the flower comes
I should see this card even if the rest doesn't show up
but in reality that's not how it works
in reality it does
since that moment whenever you're on any
page whether you
search or apply a filter
Go back to page
1 and on that page 1
only those
cards will remain
The filter applied earlier will remain and the
card data from the search
will stay right there
Do you understand what I'm trying to express
abhi my card has
a total of 10
my job application has a total of 10
job postings
when I reached the second page and when I
typed in flower I went back
e page number 1 isn't loading
so I'm creating
a new pagination
where I can see how many cards
total I have for this keyword
Now I'll show you in descending order understood That's
what I'm trying to convey and
that's exactly what happens
No matter which page you're
on whenever you use a filter
or search a new page will open
just for that result's card
If you're showing me this kind of path
then what should the real me have been like
You've already seen it that's our problem right now — when it
was happening I was
showing it to you — I went to look for a job
When you go to the second page
you end up back on the second
page when I go back I end up
on page 1—no not even page 1
The part of my page that's here is disappearing
here it goes forward
it's vanishing right there
your usage effect call is bound to happen
every time you make a call and within that your
update filter function call
That's just how it is
and that's exactly the update filter we have
If I remove this too if I
remove this too
if I go to page 2
you see something like that
if you type flowers here
you'll see no jobs found
You saw the reason behind it which is exactly what I
wanted you to see
Try it yourself—what's going on here
On page 2 you're supposed to see 9
cards and my flowers
I barely have 3
to already 9-3
to feel negative I'm heading out
You can't see anything
here so we need to fix this
And Jo who had previously explained the main idea told you to implement it here
Leave it as it is
I'll keep going here
basically this is our entire update filter function — completely remove
this entire update filter function —
here we have our update filter functio
As you can see guys it's
really quite simple—we just need
to make sure we only delete our
page when the time is right
what we're getting right
now is your current
value isn't it so now if the actual value is prese
It's not there or if our
actual value is
present then if
the key in params hash exists
just delete that key brother
when you're all in MATLAB
or when you're
all doing it in MATLAB or when you're all doing it in MATLAB
So it's all over right That means
the filter didn't even show up
Show me 10 people out of 10 the
filter is slightly applied that' s
the same thing I was saying brother if there's anyone like tha
Take the ball off your head remove it from the
top and yes I've confirmed
the filter change here
Because whatever it is something
did happen here and there
if our current value isn't
equal to our actual value the
If any new filter has been added
we'll set it up with params set
key actual value and also mark
the filter change as true there
If anyone has used the filter
the URL has changed
we're setting
it to true and if it remains
true then set
params set to page 1
and your route will show you something like this
I hope so guys
You now understand what we had to do here
us always
always us guys just look at this
We're also fetching from search params here right
resolve params
always take into account
whatever the user has changed
He's the one who's
supposed to worry so
we don't need to worry about him at all
You see if the user changes
anything we'll know immediately
search params
You don't seem to understand what I'm trying to convey here
this is no trick
and this is exactly it
Don't worry about where the new parameters in the update filters came
from—just make sure you check every
instance where the filters are updated
If the user has changed anything then the job
label's value is the work
type's value and we have
This trick is passing the value
here basically it's an object
You'll do this much and now we'
re making sure that if anything
gets filtered tomorrow
whatever page it is whether it's
The second page leads
to the third page
we're changing the URL on page 1
it's not leading to page 1 anymore
We are creating a new page using the
filtered data which
is the updated
data that has been processed through the
filter and now we are
creating a new page
That's all you need to do if you can
do that your task will be complete
That's it this is the end of this video for now
Now if I continue here
I'll go to the second page on Find Job
If I proceed
If I type fu and then lb I'll
get all this data in this way
I hope you understand
page 1 is reached here
page 1 if anything is changing
we're just searching for all this
behind the scene
This is it for you this is
exactly what you needed we've also
added pagination and it's all
done at a professional level
We'll show you how to do it host it properly
We'll check it on Sunday
Today we'll look into GitHub Actions basically
ow can you host automatically
so guys are you excited
because I am super excited
and a little nervous too
since finally this one we've been working on
Course that you've completed it
and finished brother almost 100 days
how can you say
please let us know by commenting
How did you like our
journey If you enjoyed
it please like it and tag this series
Instagram LinkedIn wherever you'd like to share it
thank you whatever it is
your call
o the next video guys
until then guys thank you so much take care