Compare commits
2 Commits
imp/settin
...
release-v2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
210a9a7aba | ||
|
|
6e37208f62 |
@@ -5,7 +5,7 @@ import db from "../config/db";
|
||||
import {ServerResponse} from "../models/server-response";
|
||||
import WorklenzControllerBase from "./worklenz-controller-base";
|
||||
import HandleExceptions from "../decorators/handle-exceptions";
|
||||
import {TASK_PRIORITY_COLOR_ALPHA, WorklenzColorCodes} from "../shared/constants";
|
||||
import {TASK_PRIORITY_COLOR_ALPHA, WorklenzColorCodes, WorklenzColorShades} from "../shared/constants";
|
||||
|
||||
export default class LabelsController extends WorklenzControllerBase {
|
||||
@HandleExceptions()
|
||||
@@ -73,7 +73,7 @@ export default class LabelsController extends WorklenzControllerBase {
|
||||
WHERE id = $1
|
||||
AND team_id = $2;`;
|
||||
|
||||
if (!WorklenzColorCodes.includes(req.body.color))
|
||||
if (!Object.values(WorklenzColorShades).flat().includes(req.body.color))
|
||||
return res.status(400).send(new ServerResponse(false, null));
|
||||
|
||||
const result = await db.query(q, [req.params.id, req.user?.team_id, req.body.color]);
|
||||
@@ -92,7 +92,7 @@ export default class LabelsController extends WorklenzControllerBase {
|
||||
}
|
||||
|
||||
if (req.body.color) {
|
||||
if (!WorklenzColorCodes.includes(req.body.color))
|
||||
if (!Object.values(WorklenzColorShades).flat().includes(req.body.color))
|
||||
return res.status(400).send(new ServerResponse(false, null));
|
||||
updates.push(`color_code = $${paramIndex++}`);
|
||||
values.push(req.body.color);
|
||||
|
||||
@@ -8,7 +8,7 @@ import {PASSWORD_POLICY} from "../../shared/constants";
|
||||
function isStrongPassword(password: string) {
|
||||
if (!isProduction()) return true;
|
||||
const strength = PasswordStrengthChecker.validate(password);
|
||||
return strength.value >= 2 && strength.length < 32;
|
||||
return strength.value >= 2 && strength.length <= 32;
|
||||
}
|
||||
|
||||
export default function (req: Request, res: Response, next: NextFunction) {
|
||||
|
||||
Reference in New Issue
Block a user