Skip to content

Commit

Permalink
Fixes #187 - UserFiles (uploaded product images, datasheets, pinouts …
Browse files Browse the repository at this point in the history
…etc) no longer showing up on inventory page.

Looks like a difference in querying syntax between the old Binner file provider and Sqlite.
  • Loading branch information
replaysMike committed May 4, 2023
1 parent 1b27686 commit 9628c62
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ public async Task<ICollection<StoredFile>> GetStoredFilesAsync(long partId, Stor
if (userContext == null) throw new ArgumentNullException(nameof(userContext));
await using var context = await _contextFactory.CreateDbContextAsync();
var entities = await context.StoredFiles
.Where(x => x.PartId == partId && x.StoredFileType == fileType && x.OrganizationId == userContext.OrganizationId)
.Where(x => x.PartId == partId && (fileType == null || x.StoredFileType == fileType) && x.OrganizationId == userContext.OrganizationId)
.ToListAsync();
return _mapper.Map<ICollection<StoredFile>>(entities);
}
Expand Down
1 change: 0 additions & 1 deletion Binner/Library/Binner.Common/Services/PartService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,6 @@ public async Task<bool> DeletePartSupplierAsync(PartSupplier partSupplier)
arrowResponse = (ArrowResponse?)apiResponse.Response;
}

// todo: cache part types (I think we already have it somewhere)
var partTypes = await _storageProvider.GetPartTypesAsync(_requestContext.GetUserContext());
var productImageUrls = new List<NameValuePair<string>>();
var datasheetUrls = new List<NameValuePair<DatasheetSource>>();
Expand Down

0 comments on commit 9628c62

Please sign in to comment.