treding page: fix pagination error
This commit is contained in:
1 parent
7dec0d6149
commit
282a0a413e
3 files changed
+14
-4
No files matched your search
@@ -4,13 +4,20 @@
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
.custom-group .form-select,
|
||||
.custom-group .input-group-text {
|
||||
border: 1px black solid;
|
||||
}
|
||||
|
||||
.custom-group .btn-group .btn {
|
||||
border-radius: 0; /* Remove rounding from buttons inside the group */
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.custom-group .btn-group .left-btn {
|
||||
border-top-left-radius: 0.25rem; /* Reapply rounding to the left-most button */
|
||||
border-bottom-left-radius: 0.25rem;
|
||||
/* border-top-left-radius: 0.25rem; */
|
||||
/* border-bottom-left-radius: 0.25rem; */
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.custom-group .btn-group .right-btn {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
</div>
|
||||
<div class="ms-auto">
|
||||
<div class="input-group custom-group">
|
||||
<div class="input-group-text">Period</div>
|
||||
<select class="form-select" id="single-select-field" data-placeholder="Choose one thing" style="max-width: 150px;"
|
||||
[(ngModel)]="period" (change)="updatePeriod($event)">
|
||||
<option value="day">Daily</option>
|
||||
|
||||
@@ -23,17 +23,19 @@ export class TrendingComponent {
|
||||
|
||||
setEntryType(entryType: boolean) {
|
||||
this.entryType = entryType;
|
||||
this.currentPage = 1;
|
||||
this.fetchEntries();
|
||||
}
|
||||
|
||||
updatePeriod(event: any) {
|
||||
this.period = event.target.value;
|
||||
this.currentPage = 1;
|
||||
this.fetchEntries();
|
||||
}
|
||||
|
||||
fetchEntries() {
|
||||
this.tmdbService
|
||||
.getPopular(this.currentPage, this.entryType)
|
||||
.getTrending(this.currentPage, this.entryType, this.period)
|
||||
.subscribe((myEntries) => {
|
||||
this.entries = myEntries;
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user