-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Webflow publish follow-up #14928
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
Webflow publish follow-up #14928
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
WalkthroughThe pull request includes significant updates to the Changes
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
components/webflow/actions/update-item-inventory/update-item-inventory.mjs (2)
Line range hint
38-52
: Add validation for mutually exclusive propertiesThe
quantity
andupdateQuantity
props are mutually exclusive and only work withfinite
inventory type, but these constraints aren't enforced in the code.Consider adding validation in the run method:
async run({ $ }) { const { app, // eslint-disable-next-line no-unused-vars siteId, collectionId, itemId, + inventoryType, + quantity, + updateQuantity, ...data } = this; + if (inventoryType !== 'finite' && (quantity || updateQuantity)) { + throw new Error('quantity and updateQuantity can only be used with finite inventory type'); + } + + if (quantity && updateQuantity) { + throw new Error('quantity and updateQuantity cannot be used together'); + } const response = await app.updateCollectionItemInventory(collectionId, itemId, data);
Line range hint
53-60
: Add error handling for the API callThe API call lacks proper error handling and could benefit from a more descriptive success message.
Consider enhancing the error handling:
- const response = await app.updateCollectionItemInventory(collectionId, itemId, data); + let response; + try { + response = await app.updateCollectionItemInventory(collectionId, itemId, data); + $.export("$summary", `Successfully updated inventory for item ${itemId}`); + return response; + } catch (err) { + throw new Error(`Failed to update inventory: ${err.message}`); + } - $.export("$summary", "Successfully updated item inventory"); - - return response;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
components/webflow/actions/update-item-inventory/update-item-inventory.mjs
(1 hunks)components/webflow/package.json
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- components/webflow/package.json
🔇 Additional comments (1)
components/webflow/actions/update-item-inventory/update-item-inventory.mjs (1)
7-7
: Verify the justification for major version bump
The version change from 0.0.5 to 2.0.0 indicates breaking changes, but no significant code changes are visible in this file.
Let's check the git history for breaking changes:
Summary by CodeRabbit
New Features
Bug Fixes
webflow-update-item-inventory
now at2.0.0
and@pipedream/webflow
at1.0.1
.