Skip to content

Commit 51034e2

Browse files
Allison Gruningerahmelsayed
Allison Gruninger
authored andcommitted
Create from Integrate Tab (#2296)
1 parent 6d22f8c commit 51034e2

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

AzureFunctions.AngularClient/src/app/function-integrate-v2/function-integrate-v2.component.ts

+13-12
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,19 @@ export class FunctionIntegrateV2Component extends BaseFunctionComponent {
148148
return;
149149
}
150150
this._functionAppService.getTemplates(this.context)
151-
.subscribe((templates: any) => {
152-
153-
let templateId = action.template + '-' + FunctionInfoHelper.getLanguage(this.functionInfo);
154-
let template = templates.find(t => t.id === templateId);
155-
// C# is default language. Set C# if can not found original language
156-
if (!template) {
157-
templateId = action.template + '-CSharp';
158-
template = templates.find(t => t.id === templateId);
159-
}
160-
if (template) {
161-
action.templateId = templateId;
162-
(<FunctionsNode>this.viewInfo.node.parent.parent).openCreateDashboard(DashboardType.CreateFunctionDashboard, action);
151+
.subscribe(templates => {
152+
if (templates.isSuccessful) {
153+
let templateId = action.template + '-' + FunctionInfoHelper.getLanguage(this.functionInfo);
154+
let template = templates.result.find(t => t.id === templateId);
155+
// C# is default language. Set C# if can not found original language
156+
if (!template) {
157+
templateId = action.template + '-CSharp';
158+
template = templates.result.find(t => t.id === templateId);
159+
}
160+
if (template) {
161+
action.templateId = templateId;
162+
(<FunctionsNode>this.viewInfo.node.parent.parent).openCreateDashboard(DashboardType.CreateFunctionDashboard, action);
163+
}
163164
}
164165
});
165166

0 commit comments

Comments
 (0)