Skip to content
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

Last Harvest Date Tracking for Asset Retrieval #357

Merged
merged 2 commits into from
Oct 23, 2023
Merged

Conversation

waelhanfi04
Copy link
Contributor

Pull Request Description

This pull request introduces a new feature to enhance the asset retrieval process within our application. The changes made in this PR are as follows:

1. campaign.controller.js:

  • Added a new variable called lastHarvestDate to controllers/campaign.controller.js.

  • Implemented an update operation for the CampaignLink model using await CampaignLink.updateOne(). This update operation sets the lastHarvestDate field to the value of prom.lastHarvest when a user retrieves assets.

  • Sample code snippet:

    await CampaignLink.updateOne({ id_prom: idProm }, { $set: { lastHarvestDate: prom.lastHarvest } });

    
    

2. campaignLink.model.js:

  • Added a new field lastHarvestDate of type Number to the model/campaignLink.model.js.

These changes aim to provide valuable functionality for tracking and managing the last harvest date of assets, which can be beneficial for various aspects of our application. Please review the code and provide feedback as necessary. Thank you!

@waelhanfi04 waelhanfi04 self-assigned this Oct 23, 2023
}


await CampaignLink.updateOne( { id_prom: idProm }, { $set: {lastHarvestDate: prom.lastHarvest} } )

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query object depends on a
user-provided value
.
@hichri-louay hichri-louay merged commit 6e3725e into develop Oct 23, 2023
2 of 3 checks passed
@hichri-louay hichri-louay deleted the getgain branch October 23, 2023 15:32
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.

2 participants