Skip to content

Commit

Permalink
getUsers res.json propierties;
Browse files Browse the repository at this point in the history
putUsers const id = req.params
  • Loading branch information
igardiet committed Jun 19, 2023
1 parent e207985 commit d718edc
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
const { response } = require('express');
const { response, request } = require('express');

const getUsers = (req, res = response) => {
const getUsers = (req = request, res = response) => {
const { q, name = 'No name', apiKey, page = 1, limit } = req.query;
res.json({
msg: 'get API - controller',
q,
name,
apiKey,
page,
limit,
});
};

Expand All @@ -15,9 +21,11 @@ const postUsers = (req, res = response) => {
});
};

const putUsers = (req, res) => {
const putUsers = (req, res = response) => {
const { id } = req.params;
res.json({
msg: 'put API - controller',
id,
});
};

Expand Down

0 comments on commit d718edc

Please sign in to comment.