[FEAT] Allow Admins to Update Multiple Products in a Single Request.#1179
Open
Lamido-stack wants to merge 7 commits intohngprojects:devfrom
Open
[FEAT] Allow Admins to Update Multiple Products in a Single Request.#1179Lamido-stack wants to merge 7 commits intohngprojects:devfrom
Lamido-stack wants to merge 7 commits intohngprojects:devfrom
Conversation
joboy-dev
requested changes
Mar 1, 2025
Contributor
joboy-dev
left a comment
There was a problem hiding this comment.
Where are your tests??
Contributor
Author
|
will add them |
samuelogboye
approved these changes
Mar 1, 2025
Comment on lines
+247
to
+249
| product = product_service.fetch_single_by_organisation( | ||
| db, org_id, update.product_id, current_user | ||
| ) |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[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_updateendpoint 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