diff --git a/src/containers/AudioUploader/components/AudioManuscript.tsx b/src/containers/AudioUploader/components/AudioManuscript.tsx index b8f7f9d37..fd953c743 100644 --- a/src/containers/AudioUploader/components/AudioManuscript.tsx +++ b/src/containers/AudioUploader/components/AudioManuscript.tsx @@ -95,10 +95,8 @@ const AudioManuscript = ({ audioId, audioLanguage, audioUrl, audioType }: AudioM }; const language = getLanguage(audioLanguage!); - const audioName = audioUrl?.split("audio/files/")[1]; const { data: transcribeData } = useAudioTranscription( { - audioName: audioName!, audioId: audioId!, language: language, }, diff --git a/src/modules/audio/audioApi.ts b/src/modules/audio/audioApi.ts index f01e41f63..c9a6a30a0 100644 --- a/src/modules/audio/audioApi.ts +++ b/src/modules/audio/audioApi.ts @@ -103,12 +103,8 @@ export const postAudioTranscription = async (audioName: string, audioId: number, return resolveVoidOrRejectWithError(response); }; -export const fetchAudioTranscription = ( - audioName: string, - audioId: number, - language: string, -): Promise => { - return fetchAuthorized(`${transcribeUrl}/audio/${audioName}/${audioId}/${language}`, { method: "GET" }).then((r) => +export const fetchAudioTranscription = (audioId: number, language: string): Promise => { + return fetchAuthorized(`${transcribeUrl}/audio/${audioId}/${language}`, { method: "GET" }).then((r) => resolveJsonOrRejectWithError(r), ); }; diff --git a/src/modules/audio/audioQueries.ts b/src/modules/audio/audioQueries.ts index 059a8f66e..1bae9e151 100644 --- a/src/modules/audio/audioQueries.ts +++ b/src/modules/audio/audioQueries.ts @@ -96,7 +96,6 @@ export const useAudioSearchTags = (params: UseSearchTags, options?: Partial { return useQuery({ queryKey: ["audioTranscription", params], - queryFn: () => fetchAudioTranscription(params.audioName, params.audioId, params.language), + queryFn: () => fetchAudioTranscription(params.audioId, params.language), refetchInterval: 1000, refetchIntervalInBackground: true, ...options,