Przeglądaj źródła

chore(core): Remove unused AssetService.findByFileName() method

Closes #366
Michael Bromley 5 lat temu
rodzic
commit
96ea811f4c
1 zmienionych plików z 0 dodań i 14 usunięć
  1. 0 14
      packages/core/src/service/services/asset.service.ts

+ 0 - 14
packages/core/src/service/services/asset.service.ts

@@ -58,20 +58,6 @@ export class AssetService {
         return this.connection.getRepository(Asset).findOne(id);
     }
 
-    /**
-     * Locates an Asset by the filename of the source file. If "exact" is set to false, filename will
-     * be looked up without the extension and with a "%" wildcard at the end. This is useful for finding
-     * files that may have been automatically renamed with a suffix by the AssetNamingStrategy.
-     */
-    findByFileName(fileName: string, exact: boolean = true): Promise<Asset | undefined> {
-        const source = exact ? fileName : Like(path.basename(fileName, path.extname(fileName)) + '%');
-        return this.connection.getRepository(Asset).findOne({
-            where: {
-                source,
-            },
-        });
-    }
-
     findAll(options?: ListQueryOptions<Asset>): Promise<PaginatedList<Asset>> {
         return this.listQueryBuilder
             .build(Asset, options)