|
|
@ -92,27 +92,28 @@ export default class Sort { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
await NocoCache.setList(CacheScope.SORT, [sortObj.fk_view_id], sortList); |
|
|
|
await NocoCache.setList(CacheScope.SORT, [sortObj.fk_view_id], sortList); |
|
|
|
} else { |
|
|
|
} |
|
|
|
|
|
|
|
// on insert, delete any optimised single query cache
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
const view = await View.get(row.fk_view_id, ncMeta); |
|
|
|
|
|
|
|
await View.clearSingleQueryCache(view.fk_model_id, [view]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return this.get(row.id, ncMeta).then(async (sort) => { |
|
|
|
|
|
|
|
if (!sortObj.push_to_top) { |
|
|
|
await NocoCache.appendToList( |
|
|
|
await NocoCache.appendToList( |
|
|
|
CacheScope.SORT, |
|
|
|
CacheScope.SORT, |
|
|
|
[sortObj.fk_view_id], |
|
|
|
[sortObj.fk_view_id], |
|
|
|
`${CacheScope.SORT}:${row.id}`, |
|
|
|
`${CacheScope.SORT}:${row.id}`, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
await NocoCache.appendToList( |
|
|
|
await NocoCache.appendToList( |
|
|
|
CacheScope.SORT, |
|
|
|
CacheScope.SORT, |
|
|
|
[sortObj.fk_column_id], |
|
|
|
[sortObj.fk_column_id], |
|
|
|
`${CacheScope.SORT}:${row.id}`, |
|
|
|
`${CacheScope.SORT}:${row.id}`, |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return sort; |
|
|
|
// on insert, delete any optimised single query cache
|
|
|
|
}); |
|
|
|
{ |
|
|
|
|
|
|
|
const view = await View.get(row.fk_view_id, ncMeta); |
|
|
|
|
|
|
|
await View.clearSingleQueryCache(view.fk_model_id, [view]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return this.get(row.id, ncMeta); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public getColumn(): Promise<Column> { |
|
|
|
public getColumn(): Promise<Column> { |
|
|
|