Skip to content

Commit 66fa33a

Browse files
committed
fix: apply dprint formatting to hooks.jsx
1 parent e59aea0 commit 66fa33a

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

src/generic/create-or-rerun-course/hooks.jsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,20 @@ const useCreateOrRerunCourse = (initialValues) => {
6060
intl.formatMessage(messages.disallowedCharsError),
6161
)
6262
.matches(noSpaceRule, intl.formatMessage(messages.noSpaceError)),
63-
}).test(TOTAL_LENGTH_KEY, intl.formatMessage(messages.totalLengthError, { maxLength: MAX_TOTAL_LENGTH }), function validateTotalLength() {
64-
const { org, number, run } = this?.options.originalValue || {};
65-
if ((org?.length || 0) + (number?.length || 0) + (run?.length || 0) > MAX_TOTAL_LENGTH) {
66-
return this.createError({ path: TOTAL_LENGTH_KEY, message: intl.formatMessage(messages.totalLengthError, { maxLength: MAX_TOTAL_LENGTH }) });
67-
}
68-
return true;
69-
});
63+
}).test(
64+
TOTAL_LENGTH_KEY,
65+
intl.formatMessage(messages.totalLengthError, { maxLength: MAX_TOTAL_LENGTH }),
66+
function validateTotalLength() {
67+
const { org, number, run } = this?.options.originalValue || {};
68+
if ((org?.length || 0) + (number?.length || 0) + (run?.length || 0) > MAX_TOTAL_LENGTH) {
69+
return this.createError({
70+
path: TOTAL_LENGTH_KEY,
71+
message: intl.formatMessage(messages.totalLengthError, { maxLength: MAX_TOTAL_LENGTH }),
72+
});
73+
}
74+
return true;
75+
},
76+
);
7077

7178
const {
7279
values,

0 commit comments

Comments
 (0)