run prettier formatting
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -60,7 +60,8 @@ export class CloudbuildClient implements CloudbuildApi {
|
||||
},
|
||||
);
|
||||
|
||||
const builds: ActionsListWorkflowRunsForRepoResponseData = await workflowRuns.json();
|
||||
const builds: ActionsListWorkflowRunsForRepoResponseData =
|
||||
await workflowRuns.json();
|
||||
|
||||
return builds;
|
||||
}
|
||||
|
||||
@@ -17,15 +17,16 @@ import { useAsync } from 'react-use';
|
||||
import { ActionsListWorkflowRunsForRepoResponseData } from '../../api/types';
|
||||
|
||||
export const useWorkflowRunJobs = (jobsUrl?: string) => {
|
||||
const jobs = useAsync(async (): Promise<ActionsListWorkflowRunsForRepoResponseData> => {
|
||||
if (jobsUrl === undefined) {
|
||||
return {
|
||||
builds: [],
|
||||
};
|
||||
}
|
||||
const jobs =
|
||||
useAsync(async (): Promise<ActionsListWorkflowRunsForRepoResponseData> => {
|
||||
if (jobsUrl === undefined) {
|
||||
return {
|
||||
builds: [],
|
||||
};
|
||||
}
|
||||
|
||||
const data = await fetch(jobsUrl).then(d => d.json());
|
||||
return data;
|
||||
}, [jobsUrl]);
|
||||
const data = await fetch(jobsUrl).then(d => d.json());
|
||||
return data;
|
||||
}, [jobsUrl]);
|
||||
return jobs;
|
||||
};
|
||||
|
||||
@@ -41,9 +41,12 @@ export function useWorkflowRuns({ projectId }: { projectId: string }) {
|
||||
const [page, setPage] = useState(0);
|
||||
const [pageSize, setPageSize] = useState(5);
|
||||
|
||||
const { loading, value: runs, retry, error } = useAsyncRetry<
|
||||
WorkflowRun[]
|
||||
>(async () => {
|
||||
const {
|
||||
loading,
|
||||
value: runs,
|
||||
retry,
|
||||
error,
|
||||
} = useAsyncRetry<WorkflowRun[]>(async () => {
|
||||
return api
|
||||
.listWorkflowRuns({
|
||||
projectId,
|
||||
|
||||
Reference in New Issue
Block a user