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(editor): Fix custom API call notice #10227

Merged
merged 3 commits into from
Jul 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/editor-ui/src/composables/useNodeHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@ export function useNodeHelpers() {

if (!isObject(parameters)) return false;

if ('resource' in parameters && 'operation' in parameters) {
if ('resource' in parameters || 'operation' in parameters) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since isCustomApiCallSelected is exported, and since this composable has a test file already, can we please add a test for isCustomApiCallSelected to prevent this from happening again 🙏🏽

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @elsmr can pitch in :)
Else I'll come to this later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He's OOO

const { resource, operation } = parameters;
if (!isString(resource) || !isString(operation)) return false;

return resource.includes(CUSTOM_API_CALL_KEY) || operation.includes(CUSTOM_API_CALL_KEY);
return (
(isString(resource) && resource.includes(CUSTOM_API_CALL_KEY)) ||
(isString(operation) && operation.includes(CUSTOM_API_CALL_KEY))
);
}

return false;
Expand Down
Loading