Open
Conversation
… readme for more information, simplfiied the sample code
kareemamin
commented
Jun 29, 2020
| // See README.MD for an in-depth explanation of each parameter. | ||
| module.exports = { | ||
| name: "get-top-reddit-posts", | ||
| function: require('./get-top-reddit-posts.js'), |
Contributor
Author
There was a problem hiding this comment.
let's not use the reserverd keyword function.
Let's use actionCode:
kareemamin
commented
Jun 29, 2020
| @@ -1,4 +1,6 @@ | |||
| module.exports = [ // the action function must return an object with the following parameters | |||
| // These are used to help Clay's interface provide ways to extract data from the output of this action into the table | |||
Contributor
Author
There was a problem hiding this comment.
Should we just generate this in the deploy endpoint automatically unless it's provided.
kareemamin
commented
Jun 29, 2020
| description: "The number of posts to fetch" | ||
| } | ||
| ], | ||
| outputParameterSchema: require('./output_parameter_schema.js'), |
Contributor
Author
There was a problem hiding this comment.
This is optional, maybe i remove it
kareemamin
commented
Jun 29, 2020
| ], | ||
| outputParameterSchema: require('./output_parameter_schema.js'), | ||
| inputSample: require('./test-inputs').goodSample, | ||
| outputSample: require('./output_sample.js'), |
Contributor
Author
There was a problem hiding this comment.
Can we just generate this automatically based on the input sample?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… readme for more information, simplfiied the sample code
Clubhouse Story
https://app.clubhouse.io/clay-run/story/2915/simplify-action-template
Summary (What)
Simplify the action template so there are fewer things to change when adapting it to your own code.
Motivation (Why)
Get started faster with less help and find the README for more information.
Implementation Details (How)
folder structure:
/index.js
/actions
/actions/reddit-posts
action-definition.js
reddit-posts.js
output-sample.js
output-schema.js
test-inputs.js
Testing
N/A