Skip to content

Commit 5c0292b

Browse files
committed
format
1 parent d27cfc4 commit 5c0292b

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

site/src/api/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,8 +992,8 @@ class ApiMethods {
992992
let latestJobInfo: TypesGen.ProvisionerJob | undefined = undefined;
993993

994994
while (
995-
!["succeeded", "canceled"].some(
996-
(status) => latestJobInfo?.status.includes(status),
995+
!["succeeded", "canceled"].some((status) =>
996+
latestJobInfo?.status.includes(status),
997997
)
998998
) {
999999
const { job } = await this.getWorkspaceBuildByNumber(

site/src/pages/TemplateSettingsPage/TemplateVariablesPage/TemplateVariablesForm.tsx

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -157,26 +157,27 @@ const ValidationSchemaForTemplateVariables = (
157157
.of(
158158
Yup.object().shape({
159159
name: Yup.string().required(),
160-
value: Yup.string().test("verify with template", (val, ctx) => {
161-
const name = ctx.parent.name;
162-
const templateVariable = templateVariables.find(
163-
(variable) => variable.name === name,
164-
);
165-
if (templateVariable?.sensitive) {
166-
// It's possible that the secret is already stored in database,
167-
// so we can't properly verify the "required" condition.
168-
return true;
169-
}
170-
if (templateVariable?.required) {
171-
if (!val || val.length === 0) {
172-
return ctx.createError({
173-
path: ctx.path,
174-
message: "Variable is required.",
175-
});
160+
value: Yup.string()
161+
.test("verify with template", (val, ctx) => {
162+
const name = ctx.parent.name;
163+
const templateVariable = templateVariables.find(
164+
(variable) => variable.name === name,
165+
);
166+
if (templateVariable?.sensitive) {
167+
// It's possible that the secret is already stored in database,
168+
// so we can't properly verify the "required" condition.
169+
return true;
176170
}
177-
}
178-
return true;
179-
}),
171+
if (templateVariable?.required) {
172+
if (!val || val.length === 0) {
173+
return ctx.createError({
174+
path: ctx.path,
175+
message: "Variable is required.",
176+
});
177+
}
178+
}
179+
return true;
180+
}),
180181
}),
181182
)
182183
.required();

0 commit comments

Comments
 (0)