Skip to content

Avoid passing the whole request object as an argument #24

Description

@eliasmalik

In many of your DB functions, you are passing the whole request object directly as an argument:
https://github.com/FACG2/Week-8-Blogs/blob/master/src/model/queries.js#L50

This means that your database functions need to understand the form of the request object and how to get the data they need from it. This is knowledge that they don't really need. Only the controller should know about the structure of requests made to the server. It's the controller that should deal with the extracting data from the request payload and then calling the DB functions with the correct parameters.

Instead of passing the whole request object, just pass the parameters that are needed.

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