Skip to content

Commit

Permalink
Reject null, 0, empty string as shade
Browse files Browse the repository at this point in the history
  • Loading branch information
RedwanPlague committed Sep 25, 2023
1 parent 15e562e commit f71a922
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pages/api/config/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const handler = async (req: NextApiRequest, res: Response) => {

const shade = req.body.shade;
const validShades = ["red", "green", "blue"];
if (shade != null && !validShades.includes(shade)) {
if (shade !== undefined && !validShades.includes(shade)) {
res.status(422).json({
message: `Shade cannot be ${shade}`,
details: {
Expand Down

0 comments on commit f71a922

Please sign in to comment.