Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteade5b0

Browse files
authored
fix: handle null response from the template presets endpoint (#18723)
The template presets endpoint returns a null response when a templateversion does not define any presets.
1 parent33bbf18 commiteade5b0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎site/src/api/api.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ class ApiMethods {
12371237

12381238
getTemplateVersionPresets=async(
12391239
templateVersionId:string,
1240-
):Promise<TypesGen.Preset[]>=>{
1240+
):Promise<TypesGen.Preset[]|null>=>{
12411241
constresponse=awaitthis.axios.get<TypesGen.Preset[]>(
12421242
`/api/v2/templateversions/${templateVersionId}/presets`,
12431243
);

‎site/src/pages/TasksPage/TasksPage.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ export const data = {
610610
templateVersionId:string,
611611
):Promise<Task>{
612612
constpresets=awaitAPI.getTemplateVersionPresets(templateVersionId);
613-
constdefaultPreset=presets.find((p)=>p.Default);
613+
constdefaultPreset=presets?.find((p)=>p.Default);
614614
constworkspace=awaitAPI.createWorkspace(userId,{
615615
name:`task-${generateWorkspaceName()}`,
616616
template_version_id:templateVersionId,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp