mirror of
https://github.com/coder/coder.git
synced 2026-10-24 01:26:25 +08:00
fix: handle null response from the template presets endpoint (#18723)
The template presets endpoint returns a null response when a template version does not define any presets.
This commit is contained in:
+1
-1
@@ -1237,7 +1237,7 @@ class ApiMethods {
|
||||
|
||||
getTemplateVersionPresets = async (
|
||||
templateVersionId: string,
|
||||
): Promise<TypesGen.Preset[]> => {
|
||||
): Promise<TypesGen.Preset[] | null> => {
|
||||
const response = await this.axios.get<TypesGen.Preset[]>(
|
||||
`/api/v2/templateversions/${templateVersionId}/presets`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user