feat: protected routes for clinic docs update

fix: doc upload after rejection
This commit is contained in:
2025-05-21 11:25:07 +05:30
parent 3d91cee029
commit 35f21f2749
10 changed files with 404 additions and 100 deletions
+1 -6
View File
@@ -116,10 +116,7 @@ const CustomFileUpload = forwardRef(function CustomFileUpload(
try {
setIsLoading(true);
const response = await getPresignedUrl(filePayload);
// Debug the response structure
console.log('API Response:', response);
// Check if we have a valid response with the expected structure
if (response?.data?.data?.Key) {
// Use the Key from the response
@@ -128,7 +125,6 @@ const CustomFileUpload = forwardRef(function CustomFileUpload(
} else {
// If the expected structure is not found, try to find the key in a different location
// or use a fallback value
console.log('Response structure is different than expected');
// Try different possible paths to find the key
const key = response?.data?.Key ||
@@ -136,7 +132,6 @@ const CustomFileUpload = forwardRef(function CustomFileUpload(
response?.Key ||
value.name; // Fallback to the file name if key not found
console.log('Using key:', key);
onUploadDone(documentName, key);
// Try to find the API URL similarly