Skip to content

Commit

Permalink
fetch on mount
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Feb 14, 2024
1 parent e26bcbc commit c4ea56c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Components/Patient/FileUpload.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import axios from "axios";
import CircularProgress from "../Common/components/CircularProgress";
import { useCallback, useState, useRef, lazy, ChangeEvent } from "react";
import {
useCallback,
useState,
useRef,
lazy,
ChangeEvent,
useEffect,
} from "react";
import { CreateFileResponse, FileUploadModel } from "./models";
import * as Notification from "../../Utils/Notifications.js";
import { VoiceRecorder } from "../../Utils/VoiceRecorder";
Expand Down Expand Up @@ -334,6 +341,10 @@ export const FileUpload = (props: FileUploadProps) => {
setIsLoading(false);
}, [id, offset]);

useEffect(() => {
fetchData();
}, [fetchData]);

// Store all audio urls for each audio file
const audio_urls = async (files: FileUploadModel[]) => {
const audioFiles = files.filter((x) => x.file_category === "AUDIO");
Expand Down

0 comments on commit c4ea56c

Please sign in to comment.