Fixes discussed during call w/ Mathieu

This commit is contained in:
Koper
2023-08-29 21:22:05 +07:00
parent d379dc2376
commit deb713e776
5 changed files with 49 additions and 39 deletions

View File

@@ -1,6 +1,5 @@
import { useEffect, useState } from "react";
import { DefaultApi, V1TranscriptsCreateRequest } from "../api/apis/DefaultApi";
import { Configuration } from "../api/runtime";
import { GetTranscript } from "../api";
import getApi from "../lib/getApi";
@@ -11,13 +10,11 @@ type UseTranscript = {
createTranscript: () => void;
};
const useTranscript = (): UseTranscript => {
const useTranscript = (api: DefaultApi): UseTranscript => {
const [response, setResponse] = useState<GetTranscript | null>(null);
const [loading, setLoading] = useState<boolean>(false);
const [error, setError] = useState<string | null>(null);
const api = getApi();
const createTranscript = () => {
setLoading(true);
const requestParameters: V1TranscriptsCreateRequest = {