Skip to content

Commit

Permalink
Update validator to use validateData instead of rubric
Browse files Browse the repository at this point in the history
  • Loading branch information
Myranae committed Nov 18, 2024
1 parent 539b8cc commit 109df1b
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import type {PerseusStrings} from "../../strings";
import type {PerseusScore} from "../../types";
import type {
PerseusCategorizerRubric,
PerseusCategorizerUserInput,
PerseusCategorizerValidationData,
} from "../../validation.types";

function validateCategorizer(
userInput: PerseusCategorizerUserInput,
rubric: PerseusCategorizerRubric,
validationData: PerseusCategorizerValidationData,
strings: PerseusStrings,
): Extract<PerseusScore, {type: "invalid"}> | null {
const incomplete = rubric.items.some((_, i) => userInput.values[i] == null);
const incomplete = validationData.items.some(
(_, i) => userInput.values[i] == null,
);

if (incomplete) {
return {
Expand Down

0 comments on commit 109df1b

Please sign in to comment.