From 02affd52529bcd4571afd658231eb1f9acfbe2b6 Mon Sep 17 00:00:00 2001 From: Nickolas Gupton Date: Sun, 10 Nov 2024 00:39:22 -0600 Subject: [PATCH] Fix a couple issues from sonar --- Backend/Bones.Api/Controllers/ProjectController.cs | 5 +++-- Frontend/Bones.WebUI/Layout/MainLayout.razor.cs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Backend/Bones.Api/Controllers/ProjectController.cs b/Backend/Bones.Api/Controllers/ProjectController.cs index 0074e15..992c86d 100644 --- a/Backend/Bones.Api/Controllers/ProjectController.cs +++ b/Backend/Bones.Api/Controllers/ProjectController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; using Bones.Api.Models; using Bones.Backend.Features.ProjectManagement.Projects.CreateProject; @@ -23,7 +24,7 @@ public sealed class ProjectController(ISender sender) : BonesControllerBase(send /// /// Name of the project to create /// Optionally the organization that this should be created under, if not specified will be created for the requesting user. - public record CreateProjectRequest(string Name, Guid? OrganizationId = null); + public record CreateProjectRequest([Required] string Name, Guid? OrganizationId = null); /// /// Creates a new project @@ -49,7 +50,7 @@ public async Task CreateProjectAsync([FromBody] CreateProjectReque /// /// OwnerType to get /// Optionally the organization that this should be created under, if not specified will be created for the requesting user. - public record GetProjectsByOwnerRequest(OwnershipType OwnerType, Guid? OrganizationId = null); + public record GetProjectsByOwnerRequest([Required] OwnershipType OwnerType, Guid? OrganizationId = null); /// /// Gets the projects for the current user, or specified organization diff --git a/Frontend/Bones.WebUI/Layout/MainLayout.razor.cs b/Frontend/Bones.WebUI/Layout/MainLayout.razor.cs index cdd2fc2..daab277 100644 --- a/Frontend/Bones.WebUI/Layout/MainLayout.razor.cs +++ b/Frontend/Bones.WebUI/Layout/MainLayout.razor.cs @@ -30,7 +30,7 @@ protected MudTheme Theme private bool _open = false; - private record ProjectDropDownModel + private sealed record ProjectDropDownModel { public required string ProjectName { get; init; }