Skip to content

Commit aa2782b

Browse files
committed
Allow missing mutable parameters to be specified
1 parent 434b912 commit aa2782b

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

site/src/api/api.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,7 @@ describe("api.ts", () => {
185185
jest.spyOn(api, "getWorkspaceBuildParameters").mockResolvedValue([])
186186
jest
187187
.spyOn(api, "getTemplateVersionRichParameters")
188-
.mockResolvedValue([
189-
MockTemplateVersionParameter1,
190-
{ ...MockTemplateVersionParameter2, mutable: false },
191-
])
188+
.mockResolvedValue([MockTemplateVersionParameter1])
192189

193190
let error = new Error()
194191
try {
@@ -198,8 +195,6 @@ describe("api.ts", () => {
198195
}
199196

200197
expect(error).toBeInstanceOf(api.MissingBuildParameters)
201-
// Verify if the correct missing parameters are being passed
202-
// It should not require immutable parameters
203198
expect((error as api.MissingBuildParameters).parameters).toEqual([
204199
MockTemplateVersionParameter1,
205200
])

site/src/api/api.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -976,9 +976,7 @@ const getMissingParameters = (
976976
templateParameters: TypesGen.TemplateVersionParameter[],
977977
) => {
978978
const missingParameters: TypesGen.TemplateVersionParameter[] = []
979-
const requiredParameters = templateParameters.filter(
980-
(p) => p.required && p.mutable,
981-
)
979+
const requiredParameters = templateParameters.filter((p) => p.required)
982980

983981
for (const parameter of requiredParameters) {
984982
// Check if there is a new value

0 commit comments

Comments
 (0)