diff --git a/Controllers/FocusTasksController.cs b/Controllers/FocusTasksController.cs index 1f297fc..9dd4e95 100644 --- a/Controllers/FocusTasksController.cs +++ b/Controllers/FocusTasksController.cs @@ -33,6 +33,12 @@ public class FocusTasksController : ControllerBase if (string.IsNullOrWhiteSpace(dto.Title)) return BadRequest("Title is required"); + if (dto.Title.Length > 255) + return BadRequest("Title must not exceed 255 characters"); + + if (dto.Description != null && dto.Description.Length > 2000) + return BadRequest("Description must not exceed 2000 characters"); + var maxOrder = await _context.FocusTasks.MaxAsync(t => (int?)t.Order) ?? 0; var task = new FocusTask @@ -58,10 +64,18 @@ public class FocusTasksController : ControllerBase return NotFound(); if (!string.IsNullOrWhiteSpace(dto.Title)) + { + if (dto.Title.Length > 255) + return BadRequest("Title must not exceed 255 characters"); task.Title = dto.Title; + } if (dto.Description != null) + { + if (dto.Description.Length > 2000) + return BadRequest("Description must not exceed 2000 characters"); task.Description = dto.Description; + } if (dto.Order.HasValue) task.Order = dto.Order.Value; @@ -88,7 +102,7 @@ public class FocusTasksController : ControllerBase var task = await _context.FocusTasks.FindAsync(order.Id); if (task != null) { - // Invertiere die Order: höchste wird niedrigste und umgekehrt + // Invertiere die Order: h�chste wird niedrigste und umgekehrt task.Order = maxOrder - order.Order; task.UpdatedAt = DateTime.UtcNow; _context.FocusTasks.Update(task); @@ -97,7 +111,7 @@ public class FocusTasksController : ControllerBase await _context.SaveChangesAsync(); - // Rückgabe: absteigend sortiert (neue oben) + // R�ckgabe: absteigend sortiert (neue oben) return Ok(await _context.FocusTasks.OrderByDescending(t => t.Order).ToListAsync()); } diff --git a/Dockerfile b/Dockerfile index 2c82911..3155012 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,16 +8,12 @@ RUN npm run build # Stage 2: .NET Publish FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build -RUN apt-get update && apt-get install -y curl && \ - curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ - apt-get install -y nodejs && \ - rm -rf /var/lib/apt/lists/* WORKDIR /src COPY *.csproj *.sln ./ RUN dotnet restore COPY . . COPY --from=frontend /app/client/build ./client/build -RUN dotnet publish FocusApp.csproj -c Release -o /app/publish --no-restore +RUN dotnet publish FocusApp.csproj -c Release -o /app/publish --no-restore -p:SkipFrontendBuild=true # Stage 3: Runtime FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime diff --git a/FocusApp.csproj b/FocusApp.csproj index bd3e8be..3c9eddd 100644 --- a/FocusApp.csproj +++ b/FocusApp.csproj @@ -22,8 +22,8 @@ - - + + diff --git a/FocusApp.sln b/FocusApp.sln index d1432b0..c6090b9 100644 --- a/FocusApp.sln +++ b/FocusApp.sln @@ -7,7 +7,6 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{12345678-1234-1234-1234-123456789012}" ProjectSection(SolutionItems) = preProject .gitignore = .gitignore - deploy.ps1 = deploy.ps1 Directory.Build.props = Directory.Build.props README.md = README.md EndProjectSection diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json index 34e02e9..9c167f6 100644 --- a/Properties/launchSettings.json +++ b/Properties/launchSettings.json @@ -6,7 +6,7 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "https://localhost:62966;http://localhost:62967" + "applicationUrl": "http://localhost:5000" } } } \ No newline at end of file