Skip to content

feat: support items data saved to backend#12

Merged
NaoCoding merged 2 commits into
mainfrom
feat/items
Jun 1, 2026
Merged

feat: support items data saved to backend#12
NaoCoding merged 2 commits into
mainfrom
feat/items

Conversation

@MaxWutw
Copy link
Copy Markdown
Contributor

@MaxWutw MaxWutw commented May 29, 2026

This pull request refines how profile updates are handled in the patch method of game_data/views.py. The main focus is on optimizing database updates by specifying only the fields that have changed, rather than saving the entire profile or unrelated fields. This helps improve performance and data integrity.

Optimized profile updates:

  • The profile.save() call in the main patch flow now uses the update_fields parameter to only update relevant fields, reducing unnecessary database writes.
  • In the inventory update section, the update_fields list is dynamically built to include only the fields that were actually changed, ensuring only modified fields are saved.

Code cleanup and simplification:

  • Removed redundant loops that set profile fields multiple times, simplifying the update logic for profile attributes.

@NaoCoding NaoCoding merged commit 67e8283 into main Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants