Skip to content

Move mongoose trims to schema #46

@HyperSprite

Description

@HyperSprite

Right now each save or update has its own trim. This leads to a lot of duplicate code and the possibility that the trims will not match. I would like to move the trim to the schema so they only need to be declared once. Also, when adding a new field, both the schema and the trim could be taken care of at the same time.

Considering the possibility of iterating through saved object against either another object or using a switch. A switch, with fall through would be less code but may not be as easy to read... An object would be basically what I am doing now in the handlers to trim and save.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions