Skip to content

Commit

Permalink
Remove oldValue since it's not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
JackWilb committed Dec 14, 2021
1 parent 5a63257 commit cf19d56
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/views/TableDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ export default Vue.extend({
// eslint-disable-next-line @typescript-eslint/no-explicit-any
options: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
handler(this: any, newValue: DataOptions, oldValue: DataOptions) {
this.update(newValue, oldValue);
handler(this: any, newValue: DataOptions) {
this.update(newValue);
},
deep: true,
},
Expand All @@ -222,13 +222,7 @@ export default Vue.extend({
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async update(this: any, newValue: DataOptions, oldValue: DataOptions) {
const changed = (Object.keys(newValue) as (keyof DataOptions)[]).filter((key) => newValue[key] !== oldValue[key]);
if (changed.includes('sortBy') || changed.includes('sortDesc')) {
this.options.page = 1;
}
async update(this: any, newValue: DataOptions) {
this.loading = true;
const result = await api.table(this.workspace, this.table, {
Expand Down

0 comments on commit cf19d56

Please sign in to comment.