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

fix: Update Relations on Stock Location update #2805

Merged

Conversation

dylviz
Copy link
Contributor

@dylviz dylviz commented Apr 22, 2024

The Stock Location update method was not updating relation customFields

Refs: #2804

Description

Essentially just a few lines of code added to the update function on StockLocation service file. This will allow relation customField entities to be updated along with the StockLocation update.

Here are the added lines. Instead of just saving, we now save, then update relation then return a promise off of assertFound

await this.connection.getRepository(ctx, StockLocation).save(updatedStockLocation);
await this.customFieldRelationService.updateRelations(
    ctx,
    StockLocation,
    input,
    updatedStockLocation,
);
return assertFound(this.findOne(ctx, updatedStockLocation.id));

Breaking changes

No Breaking Changes, Just additional steps included in update() function

Screenshots

N/A

Checklist

📌 Always:

  • I have set a clear title
  • My PR is small and contains a single feature
  • I have checked my own PR

👍 Most of the time:

  • I have added or updated test cases
  • I have updated the README if needed

The Stock Location update method was not updating relation customFields

Refs: vendure-ecommerce#2804
Copy link

netlify bot commented Apr 22, 2024

Deploy Preview for effervescent-donut-4977b2 canceled.

Name Link
🔨 Latest commit 98e6481
🔍 Latest deploy log https://app.netlify.com/sites/effervescent-donut-4977b2/deploys/6626c3cda5c94c000805871e

@dylviz
Copy link
Contributor Author

dylviz commented Apr 22, 2024

@michaelbromley michaelbromley merged commit 47b1116 into vendure-ecommerce:master Apr 23, 2024
15 of 16 checks passed
@michaelbromley
Copy link
Member

Thank you!

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