feat: protected routes for clinic docs update
fix: doc upload after rejection
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user