Skip to content

Commit

Permalink
Merge pull request #571 from ChicagoWorldcon/stag-paging-issue
Browse files Browse the repository at this point in the history
PLAN-677 Stag paging issue
  • Loading branch information
Gailbear authored Aug 7, 2022
2 parents c4a554c + faa5148 commit 51c012b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/javascript/profile/session_ranker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export default {
this.removeInterest(this.assignment, this.person_id).then(
(res) => {
this.assignment = null
this.fetchPaged()
this.fetchAll()
}
)
}
Expand Down Expand Up @@ -222,7 +222,7 @@ export default {
// If there is no pager we need to get the initial collection somehow
// Order should be by created_at date and ranking ...
this.assignment = null
this.fetchPaged();
this.fetchAll();
}
}
</script>
Expand Down
8 changes: 4 additions & 4 deletions app/javascript/sessions/assign_participants.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,19 @@ export default {
},
methods: {
reorder() {
this.fetchPaged(false)
this.fetchAll(false)
},
saveAssignment(assignment) {
this.save(assignment).then(
() => {
// TODO?
// this.refreshSession()
this.fetchPaged(false)
this.fetchAll(false)
}
).catch(
() => {
// this.refreshSession()
this.fetchPaged(false)
this.fetchAll(false)
}
)
},
Expand All @@ -120,7 +120,7 @@ export default {
mounted() {
// If there is no pager we need to get the initial collection somehow
// Order should be by created_at date and ranking ...
this.fetchPaged(false); // false to not clear store of existing models
this.fetchAll(false); // false to not clear store of existing models
this.select_model('session_assignment', null)
this.select_model('person', null);
}
Expand Down
8 changes: 6 additions & 2 deletions app/javascript/store/table.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const tableMixin = {
this.tempCurrentPage = this.currentPage;
}
},
fetchPaged(clear=true) {
fetchAll(clear=true, perPage=null) {
this.tableBusy = true;
this.shall_clear = clear
let _filter = JSON.stringify(this.filter)
Expand All @@ -108,7 +108,8 @@ export const tableMixin = {
// What URL does this use
this.fetch(
{
perPage: this.perPage,
// THIS IS THE PROBLEM
perPage: perPage,
sortOrder: this.sortDesc ? 'desc' : 'asc',
sortBy: this.sortBy,
filter: _filter,
Expand All @@ -127,6 +128,9 @@ export const tableMixin = {
res(data);
}).catch(rej).finally(() => this.tableBusy = false); // TODO maybe actually handle it here??
})
},
fetchPaged(clear=true) {
this.fetchAll(clear, this.perPage);
}
},
mounted() {
Expand Down

0 comments on commit 51c012b

Please sign in to comment.