mirror of
https://github.com/n8n-io/n8n-docs.git
synced 2025-11-20 17:48:34 +00:00
modify API call and add exception for IMAP node
This commit is contained in:
parent
d0aefd7e92
commit
8347088f5c
7
main.py
7
main.py
@ -7,8 +7,11 @@ def define_env(env):
|
||||
|
||||
@env.macro
|
||||
def templatesWidget(title, slug):
|
||||
node_for_template = title.replace(' ', '+')
|
||||
response = requests.get(url = f'https://api.n8n.io/api/templates/search?rows=3&search=&category=&apps={node_for_template}&page=1&sort=views:desc')
|
||||
if(title == 'Email Trigger (IMAP)'):
|
||||
node_for_template = 'email+imap'
|
||||
else:
|
||||
node_for_template = title.replace(' ', '+')
|
||||
response = requests.get(url = f'https://api.n8n.io/api/templates/search?rows=3&search={node_for_template}&page=1&sort=views:desc')
|
||||
data = response.json()
|
||||
# not all nodes have three templates
|
||||
try:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user