Browse Source

fix(uploader): ensure return types are inferred as const for upload results

Dave 1 month ago
parent
commit
5a162ddfcd

+ 5 - 5
apps/box-mgnt-api/src/mgnt-backend/feature/uploader/uploader.service.ts

@@ -113,7 +113,7 @@ export class UploaderService {
       return {
         keyPath: keyPaths.localKeyPath,
         imageStorage: 'LOCAL_ONLY',
-      };
+      } as const;
     }
 
     if (preferredStrategy === 'S3_AND_LOCAL') {
@@ -137,7 +137,7 @@ export class UploaderService {
       return {
         keyPath: keyPaths.localKeyPath,
         imageStorage: 'S3_AND_LOCAL',
-      };
+      } as const;
     }
 
     if (preferredStrategy === 'S3_ONLY') {
@@ -157,19 +157,19 @@ export class UploaderService {
         return {
           keyPath: keyPaths.baseKeyPath,
           imageStorage: 'S3_ONLY',
-        };
+        } as const;
       } catch (err) {
         return {
           keyPath: keyPaths.localKeyPath,
           imageStorage: 'LOCAL_ONLY',
-        };
+        } as const;
       }
     }
 
     return {
       keyPath: keyPaths.localKeyPath,
       imageStorage: 'LOCAL_ONLY',
-    };
+    } as const;
   }
 
   private resolveMaxBytes(