Code cleanup

This commit is contained in:
jvyden 2021-11-06 14:21:31 -04:00
commit 142b65b481
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
2 changed files with 2 additions and 0 deletions

View file

@ -74,6 +74,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
public async Task<IActionResult> UserPhotos([FromQuery] string user)
{
User? userFromQuery = await this.database.Users.FirstOrDefaultAsync(u => u.Username == user);
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
if (user == null) return this.NotFound();
List<Photo> photos = await this.database.Photos.Where(p => p.CreatorId == userFromQuery.UserId).Take(10).ToListAsync();

View file

@ -1,3 +1,4 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;