Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes to the GET DeleteSymbols endpoint #6937

Merged
merged 2 commits into from
Mar 5, 2019

Conversation

scottbommarito
Copy link
Contributor

A couple fixes that were done while working on #6912 but moved to here because they are separate to it

Two issues fixed here:

  1. DeleteSymbols requires all versions of the package but doesn't call FindPackagesById
  2. DeleteSymbols uses SelectList (which uses reflection and dynamic objects) instead of IEnumerable<SelectListItem>

@scottbommarito
Copy link
Contributor Author

scottbommarito commented Feb 26, 2019

(Tests will be fixed after I pull in #6912.)

@scottbommarito scottbommarito changed the base branch from master to dev February 26, 2019 22:13
Copy link
Contributor

@skofman1 skofman1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

.Select(p => p.LatestSymbolPackage())
.Where(sp => sp != null && sp.StatusKey == PackageStatus.Available)
.Select(sp => new PackageViewModel(sp.Package));
.Where(p => (p.LatestSymbolPackage()?.StatusKey ?? PackageStatus.Deleted) == PackageStatus.Available);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of ?? PackageStatus.Deleted? null by itself is not equal to any enum value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enums are ints internally, which means they don't support null.
Therefore, I must convert the null to a valid enum value before I can compare.

@scottbommarito scottbommarito merged commit e428f5b into dev Mar 5, 2019
@scottbommarito scottbommarito deleted the sb-deletesymbolsselectlist branch March 5, 2019 20:08
@scottbommarito scottbommarito restored the sb-deletesymbolsselectlist branch July 22, 2019 23:20
@scottbommarito scottbommarito deleted the sb-deletesymbolsselectlist branch July 22, 2019 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants