-
Notifications
You must be signed in to change notification settings - Fork 3
add call crud actions on integration #257
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,6 +19,11 @@ import { | |||||||||||||||||||||||||
| facebookRepairIntegrations, | ||||||||||||||||||||||||||
| facebookCreateIntegrations, | ||||||||||||||||||||||||||
| } from '@/integrations/facebook/messageBroker'; | ||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||
| callCreateIntegration, | ||||||||||||||||||||||||||
| callRemoveIntergration, | ||||||||||||||||||||||||||
| callUpdateIntegration, | ||||||||||||||||||||||||||
| } from '~/modules/integrations/call/messageBroker'; | ||||||||||||||||||||||||||
|
Comment on lines
+22
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the typo in the imported function name. There's a typo in import {
callCreateIntegration,
- callRemoveIntergration,
+ callRemoveIntegration,
callUpdateIntegration,
} from '~/modules/integrations/call/messageBroker';Also ensure the function name is corrected in 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| interface IntegrationParams { | ||||||||||||||||||||||||||
| integrationId: string; | ||||||||||||||||||||||||||
|
|
@@ -52,6 +57,8 @@ export const sendCreateIntegration = async ( | |||||||||||||||||||||||||
| switch (serviceName) { | ||||||||||||||||||||||||||
| case 'facebook': | ||||||||||||||||||||||||||
| return await facebookCreateIntegrations({ subdomain, data }); | ||||||||||||||||||||||||||
| case 'call': | ||||||||||||||||||||||||||
| return await callCreateIntegration({ subdomain, data }); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| case 'instagram': | ||||||||||||||||||||||||||
| // TODO: Implement Instagram integration | ||||||||||||||||||||||||||
|
|
@@ -80,6 +87,8 @@ export const sendUpdateIntegration = async ( | |||||||||||||||||||||||||
| switch (serviceName) { | ||||||||||||||||||||||||||
| case 'facebook': | ||||||||||||||||||||||||||
| return await facebookUpdateIntegrations({ subdomain, data }); | ||||||||||||||||||||||||||
| case 'call': | ||||||||||||||||||||||||||
| return await callUpdateIntegration({ subdomain, data }); | ||||||||||||||||||||||||||
|
Comment on lines
+90
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify the return value handling in callUpdateIntegration. The implementation is consistent with the existing pattern. However, based on the messageBroker implementation, 🏁 Script executed: #!/bin/bash
# Check the return behavior of callUpdateIntegration function
ast-grep --pattern 'export async function callUpdateIntegration($_) {
$$$
}'Length of output: 1130 Ensure The Please update the function to return the result of export async function callUpdateIntegration({ subdomain, data }) {
try {
- updateIntegration({ subdomain, data });
+ return await updateIntegration({ subdomain, data });
} catch (e) {
return {
status: 'error',
errorMessage: `Failed to update integration: ${e.message}`,
};
}
}This ensures callers always get a well-defined response. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| case 'instagram': | ||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||
|
|
@@ -106,6 +115,8 @@ export const sendRemoveIntegration = async ( | |||||||||||||||||||||||||
| switch (serviceName) { | ||||||||||||||||||||||||||
| case 'facebook': | ||||||||||||||||||||||||||
| return await facebookRemoveIntegrations({ subdomain, data }); | ||||||||||||||||||||||||||
| case 'call': | ||||||||||||||||||||||||||
| return await callRemoveIntergration({ subdomain, data }); | ||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo in sendRemoveIntegration: 'callRemoveIntergration' is used. Consider renaming to 'callRemoveIntegration' for consistency. |
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| case 'instagram': | ||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
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.
Typo in import: 'callRemoveIntergration' seems misspelled. Consider renaming to 'callRemoveIntegration' for consistency.