Skip to content

Commit

Permalink
Merge pull request #590 from amvanbaren/fix=getfile-multiple-results
Browse files Browse the repository at this point in the history
Fix getFile duplicates
  • Loading branch information
amvanbaren committed Nov 10, 2022
2 parents 464d6a4 + 89a4c63 commit 95d53c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface FileResourceRepository extends Repository<FileResource, Long> {

Streamable<FileResource> findByStorageType(String storageType);

FileResource findByExtensionAndNameIgnoreCase(ExtensionVersion extVersion, String name);
FileResource findFirstByExtensionAndNameIgnoreCaseOrderByType(ExtensionVersion extVersion, String name);

FileResource findByExtensionAndType(ExtensionVersion extVersion, String type);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public Streamable<FileResource> findFilesByStorageType(String storageType) {
}

public FileResource findFileByName(ExtensionVersion extVersion, String name) {
return fileResourceRepo.findByExtensionAndNameIgnoreCase(extVersion, name);
return fileResourceRepo.findFirstByExtensionAndNameIgnoreCaseOrderByType(extVersion, name);
}

public FileResource findFileByTypeAndName(ExtensionVersion extVersion, String type, String name) {
Expand Down

0 comments on commit 95d53c3

Please sign in to comment.