Provides utility functions for to-do validation.
- Source:
Methods
(static) validateCreateRequestBody(body, requiredFields)
Validates the request body for required fields.
Parameters:
Name | Type | Description |
---|---|---|
body |
Object | The request body. |
requiredFields |
Array.<string> | The list of required fields. |
- Source:
Throws:
-
- Throws an error if any of the required fields are missing.
- Type
- Error
(static) validateCreateTodoInput(title, description)
validateCreateTodoInput
Parameters:
Name | Type | Description |
---|---|---|
title |
string | The title of the to-do item. |
description |
string | The description of the to-do item. |
- Source:
Throws:
-
- Throws an error if the title or description is invalid.
- Type
- Error