Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Глаза дракона #9

Merged
merged 5 commits into from
Nov 1, 2024

Conversation

JIlyaS
Copy link
Contributor

@JIlyaS JIlyaS commented Oct 31, 2024

public async index(req: Request, res: Response): Promise<void> {
const limit = req.query.limit ? Number(req.query.limit) : DEFAULT_OFFER_COUNT;
public async index({ query } : Request<unknown, unknown, unknown, RequestQuery>, res: Response): Promise<void> {
const limit = query?.limit ? Number(query.limit) : DEFAULT_OFFER_COUNT;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const limit = query.limit && !Number.isNaN(+query.limit) && +query.limit < 200 ? +query.limit : DEFAULT_OFFER_COUNT;

Comment on lines 33 to 35
return (await this.userModel
.exists({_id: documentId})) !== null;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return this.userModel.exists({_id: documentId})).then(r => !!r)

@keksobot keksobot changed the title module7-task1: add validation and add middlewares Глаза дракона Nov 1, 2024
@keksobot keksobot merged commit 7b6086f into htmlacademy-nodejs-api:master Nov 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants