From 055ce0ee6cd01aa781a3914d43bd42823d929f21 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sat, 13 Jun 2020 13:58:08 +0000 Subject: [PATCH] --- Controllers/RvrController.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Controllers/RvrController.cs b/Controllers/RvrController.cs index 5f99c53..0af1787 100644 --- a/Controllers/RvrController.cs +++ b/Controllers/RvrController.cs @@ -63,6 +63,13 @@ namespace rockfishCore.Controllers return BadRequest("E1000 - Can't trial; there is already a purchased license issued for this database Id"); } + //can't do this if there is a trial request already pending + if (await ct.TrialRequest.Where(z => z.DbId == r.DbId && z.DtProcessed == null).AnyAsync()) + { + return Ok("Request awaiting approval"); + } + + System.Diagnostics.Debug.WriteLine("RvRController:Post - TODO: Test MustBeOlderThan date code"); //if there is an active trial for this db then can't do this they must request we re-release it or completely zap the database instead