-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove pipeline versions (#636)
- Loading branch information
1 parent
0e5c0ef
commit 6fb83d6
Showing
14 changed files
with
729 additions
and
358 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { PipelineListParams } from "@/types/pipelines"; | ||
import { queryOptions } from "@tanstack/react-query"; | ||
import { fetchAllPipelines } from "./pipeline-list-query"; | ||
|
||
export const pipelineQueries = { | ||
all: ["pipelines"], | ||
pipelineList: (queryParams: PipelineListParams) => | ||
queryOptions({ | ||
queryKey: [...pipelineQueries.all, queryParams], | ||
queryFn: async () => fetchAllPipelines({ params: queryParams }) | ||
}) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { FetchError } from "@/lib/fetch-error"; | ||
import { notFound } from "@/lib/not-found-error"; | ||
import { objectToSearchParams } from "@/lib/url"; | ||
import { PipelineListParams } from "@/types/pipelines"; | ||
import { apiPaths, createApiPath } from "../api"; | ||
import { fetcher } from "../fetch"; | ||
|
||
export type PipelineOverview = { | ||
params: PipelineListParams; | ||
}; | ||
|
||
export async function fetchAllPipelines({ params }: PipelineOverview) { | ||
const url = createApiPath(apiPaths.pipelines.all + "?" + objectToSearchParams(params)); | ||
const res = await fetcher(url, { | ||
method: "GET", | ||
headers: { | ||
"Content-Type": "application/json" | ||
} | ||
}); | ||
|
||
if (res.status === 404) notFound(); | ||
|
||
if (!res.ok) { | ||
throw new FetchError({ | ||
message: "Error while fetching pipelines", | ||
status: res.status, | ||
statusText: res.statusText | ||
}); | ||
} | ||
return res.json(); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.