Skip to content

Commit

Permalink
Don't do an update if no data has changed when the user calls update().
Browse files Browse the repository at this point in the history
  • Loading branch information
rizen committed May 31, 2024
1 parent f8df525 commit 32655b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ving/docs/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ outline: deep

## May 2024

### 2024-05-31
* Don't do an update if no data has changed when the user calls update().

### 2024-05-30
* Fixed and if-else-if bug in FormInput component that was causing fields to be displayed twice if it was an int.
* Fixed translation of ids in Ving Record filters.
Expand Down
2 changes: 2 additions & 0 deletions ving/record/VingRecord.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,8 @@ export class VingRecord {
* await user.update()
*/
async update() {
if (this.#dirty.length == 0)
return; // nothing worth updating
const schema = findVingSchema(getTableName(this.table));
// auto-update auto-updating date fields
for (const field of schema.props) {
Expand Down

0 comments on commit 32655b9

Please sign in to comment.