Skip to content

Commit

Permalink
Adjust code to OSH API endpoint rename
Browse files Browse the repository at this point in the history
  • Loading branch information
lbarcziova authored and Venefilyn committed Nov 25, 2024
1 parent 886a14b commit 8c72fb7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions frontend/src/apiDefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ export interface PipelineRun {
vm_image_build: unknown[]; //TODO - @Venefilyn - No clue what it should be
}

// /api/osh-scans
// /api/openscanhub-scans
export interface OSHScanGroup {
anitya_package: string | null;
anitya_project_id: number | null;
Expand All @@ -461,7 +461,7 @@ export interface OSHScanGroup {
url: string;
}

// /api/osh-scans/$id
// /api/openscanhub-scans/$id
export interface OSHScan {
anitya_package: string | null;
anitya_project_id: number | null;
Expand Down
9 changes: 6 additions & 3 deletions frontend/src/queries/osh/oshScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ export const fetchOSHScan = async ({
id,
signal,
}: fetchOSHScanProps): Promise<OSHScan> => {
const data = await fetch(`${import.meta.env.VITE_API_URL}/osh-scans/${id}`, {
signal,
})
const data = await fetch(
`${import.meta.env.VITE_API_URL}/openscanhub-scans/${id}`,
{
signal,
},
)
.then((response) => response.json())
.catch((err) => {
if (err.status === 404) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/queries/osh/oshScans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const fetchScans = async ({
signal,
}: fetchScansProps): Promise<OSHScanGroup[]> => {
const data = await fetch(
`${import.meta.env.VITE_API_URL}/osh-scans?page=${pageParam}`,
`${import.meta.env.VITE_API_URL}/openscanhub-scans?page=${pageParam}`,
{ signal },
)
.then((response) => response.json())
Expand Down

0 comments on commit 8c72fb7

Please sign in to comment.