From ec4a778b9702062ad66131652ea9b211da78d043 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 17 Dec 2020 20:57:43 +0000 Subject: [PATCH] --- server/AyaNova/biz/Review.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/AyaNova/biz/Review.cs b/server/AyaNova/biz/Review.cs index 8f33db19..99d4d49e 100644 --- a/server/AyaNova/biz/Review.cs +++ b/server/AyaNova/biz/Review.cs @@ -151,7 +151,8 @@ namespace AyaNova.Biz try { Review dbObject = await ct.Review.SingleOrDefaultAsync(m => m.Id == id); - if (dbObject == null){ + if (dbObject == null) + { AddError(ApiErrorCode.NOT_FOUND); return false; } @@ -210,13 +211,15 @@ namespace AyaNova.Biz private async Task ValidateAsync(Review proposedObj, Review currentObj) { + //TODO: Specific rules see case 3511 + bool isNew = currentObj == null; //Name required if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - + //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) @@ -247,6 +250,7 @@ namespace AyaNova.Biz private void ValidateCanDelete(Review inObj) { //whatever needs to be check to delete this object + //TODO: There are specific rules for this beyond regular roles see case 3511 } @@ -398,7 +402,7 @@ namespace AyaNova.Biz await JobsBiz.LogJobAsync(job.GId, ExceptionUtil.ExtractAllExceptionMessages(ex)); } } - await JobsBiz.LogJobAsync(job.GId, $"LT:BatchJob {job.SubType} {idList.Count}{(FailedObjectCount > 0 ? " - LT:Failed " + FailedObjectCount : "")}"); + await JobsBiz.LogJobAsync(job.GId, $"LT:BatchJob {job.SubType} {idList.Count}{(FailedObjectCount > 0 ? " - LT:Failed " + FailedObjectCount : "")}"); await JobsBiz.UpdateJobStatusAsync(job.GId, JobStatus.Completed); }