Skip to content

It's not possible to update your email address #6

Open
@Nautman

Description

@Nautman

There is no such field in updateUser.

const updateUser = [
body("username")
.optional({ nullable: false, checkFalsy: true })
.isString()
.isLength({ min: 3, max: 24 })
.matches(/^(\w+)$/)
.custom(async function (username: string, meta) {
const req = meta.req as Request;
const user = await req.services.User.getUserByUsername(username);
if (user) {
throw new Error();
}
return true;
}),
body("firstName").optional({ nullable: false, checkFalsy: true }).isString().isLength({ min: 1, max: 512 }),
body("lastName").optional({ nullable: false, checkFalsy: true }).isString().isLength({ min: 1, max: 512 }),
body("birthdate").optional({ nullable: false, checkFalsy: true }).isISO8601({ strict: true }).isBefore().toDate(),
body("gender").optional({ nullable: false, checkFalsy: true }).isString().isIn(["MALE", "FEMALE", "OTHER", "UNDISCLOSED"]),
body("profileColour").optional({ nullable: false, checkFalsy: true }).isString().isHexColor(),
body("profileStatus").optional({ nullable: false, checkFalsy: true }).isString().isLength({ min: 0, max: 32 }),
body("profileBio").optional({ nullable: false, checkFalsy: true }).isString().isLength({ min: 0, max: 1000 }),
body("profileURL")
.optional({ nullable: false, checkFalsy: true })
.isString()
.isURL({ protocols: ["http", "https"] }),
];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions