This commit is contained in:
2023-02-16 01:25:20 +00:00
parent 8fba668d52
commit 6f0455aa85
5 changed files with 46 additions and 7 deletions

View File

@@ -59,7 +59,9 @@ namespace Sockeye.Api.Controllers
//Get the most recent key for this dbid regardless if fetched or not, most recent is most recent and supersedes any other keys
//for the same database id
//this means if a user requests a trial key then buys a key but both are unfetched the bought key takes precedence or vice versa
var license = await ct.License.OrderByDescending(z => z.Id).Where(z => z.DbId == FetchRequestDbId).FirstOrDefaultAsync();
var license = await ct.License.OrderByDescending(z => z.Id)
.Where(z => z.DbId == FetchRequestDbId && z.Active == true)
.FirstOrDefaultAsync();
if (license != null)
{
//Found a recent purchased key, if not fetched then can be sent