(taskIds: any, propertyName: string = "task_ids")
| 347 | } |
| 348 | |
| 349 | function validateTaskIds(taskIds: any, propertyName: string = "task_ids") { |
| 350 | if (isNullish(taskIds)) { |
| 351 | throw new JsonHTTPResponseWithMessage(`'${propertyName}' must be provided`) |
| 352 | } |
| 353 | |
| 354 | if (!isListOfValidIds(taskIds)) { |
| 355 | const taskIdsStr = isObject(taskIds) || Array.isArray(taskIds) ? JSON.stringify(taskIds) : taskIds |
| 356 | throw new JsonHTTPResponseWithMessage(`'${propertyName}' with value '${taskIdsStr}' must be a list of integers representing scraping task ids.`) |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | export function validateUiPatchTask(jsonData: any): [string, number[]] { |
| 361 | ensureJsonBodyIsDict(jsonData); |
no test coverage detected