Skip to content

Commit

Permalink
Added interface for UrlToScan input
Browse files Browse the repository at this point in the history
  • Loading branch information
azdak committed Nov 25, 2024
1 parent 4566a05 commit 0ae4346
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/routes/addScansByPage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ScanResponse, ScanResponseJob } from "#src/utils/interfaces";
import { ScanResponse, ScanResponseJob, UrlForScan } from "#src/utils/interfaces";
import {
formatId,
validateDiscovery,
Expand Down Expand Up @@ -31,7 +31,7 @@ export const addScansByPage = async ({ request, reply }) => {
message: "An array of URLs to send is required."
};
} else {
for (const urlObj of request.body.urls) {
for (const urlObj of request.body.urls as Array<UrlForScan>) {
if (!validateUrl(urlObj.url)) {
return {
status: "error",
Expand Down
5 changes: 5 additions & 0 deletions src/utils/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ export interface ScanResponseJob {
url: string;
}

export interface UrlForScan {
url: string;
urlId: string;
}

export interface ScanResponse {
jobs: Array<ScanResponseJob>;
messages: Array<string>;
Expand Down

0 comments on commit 0ae4346

Please sign in to comment.