Skip to content

Commit

Permalink
[nan-439] allow no output for script (#1797)
Browse files Browse the repository at this point in the history
## Describe your changes
If an action has not output it would throw an error in the webapp

## Issue ticket number and link
NAN-439

## Checklist before requesting a review (skip if just adding/editing
APIs & templates)
- [ ] I added tests, otherwise the reason is: 
- [ ] I added observability, otherwise the reason is:
- [ ] I added analytics, otherwise the reason is:
  • Loading branch information
khaliqgant committed Mar 5, 2024
1 parent b1d4ab4 commit 23d28c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/webapp/src/utils/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,10 @@ export const parseInput = (flow: Flow) => {
return input;
};

export function generateResponseModel(models: NangoSyncModel[], output: string, isSync: boolean): Record<string, any> {
export function generateResponseModel(models: NangoSyncModel[], output: string | undefined, isSync: boolean): Record<string, any> {
if (!output) {
return {};
}
const model = models.find((model) => model.name === output);
const jsonResponse = generateExampleValueForProperty(model as NangoSyncModel);
if (!isSync) {
Expand Down

0 comments on commit 23d28c7

Please sign in to comment.