-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] Allow Admins to Update Multiple Products in a Single Request. #1179
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are your tests??
will add them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
product = product_service.fetch_single_by_organisation( | ||
db, org_id, update.product_id, current_user | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of fetching each product individually inside the loop, retrieve all products at once using a single query before entrying the loop for update.
This reduces the number of DB hits and speeds up processing.
[FEAT] Allow Admins to Update Multiple Products in a Single Request.
Description
This pull request introduces a new feature: a batch update functionality for multiple products in a single request. The
batch_update
endpoint that accepts a list of product updates and processes.Related Issue (Link to issue ticket)
#1122
Motivation and Context
The motivation for this change was to enable the ability to update multiple products at once, reducing the need for multiple individual update requests. This feature was required for:
How Has This Been Tested?
Testing was performed under the following conditions:
Tests were conducted using FastAPI's Swagger UI (interactive documentation)
Types of changes