From ece00c218ede04b4226bf45bcc27fc4449c4e557 Mon Sep 17 00:00:00 2001 From: LumaLivy <7350336+LumaLivy@users.noreply.github.com> Date: Sat, 20 Nov 2021 04:48:49 -0500 Subject: [PATCH] Create DeletedBy enum --- ProjectLighthouse/Controllers/ReviewController.cs | 2 +- ProjectLighthouse/Types/DeletedBy.cs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 ProjectLighthouse/Types/DeletedBy.cs diff --git a/ProjectLighthouse/Controllers/ReviewController.cs b/ProjectLighthouse/Controllers/ReviewController.cs index 4525a43d..690cdf2e 100644 --- a/ProjectLighthouse/Controllers/ReviewController.cs +++ b/ProjectLighthouse/Controllers/ReviewController.cs @@ -235,7 +235,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers if (review == null) return this.StatusCode(403, ""); review.Deleted = true; - review.DeletedBy = "level_author"; // other value is "moderator" + review.DeletedBy = DeletedBy.LevelAuthor; await this.database.SaveChangesAsync(); return this.Ok(); diff --git a/ProjectLighthouse/Types/DeletedBy.cs b/ProjectLighthouse/Types/DeletedBy.cs new file mode 100644 index 00000000..02d61ec0 --- /dev/null +++ b/ProjectLighthouse/Types/DeletedBy.cs @@ -0,0 +1,9 @@ +namespace LBPUnion.ProjectLighthouse.Types +{ + public static class DeletedBy + { + public static string Moderator { get => "moderator"; } + public static string LevelAuthor { get => "level_author"; } + // TODO: deletion types for comments (profile etc) + } +} \ No newline at end of file