mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-02 10:08:39 +00:00
Code cleanup
This commit is contained in:
parent
9b7686bb91
commit
142b65b481
2 changed files with 2 additions and 0 deletions
|
@ -74,6 +74,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
||||||
public async Task<IActionResult> UserPhotos([FromQuery] string user)
|
public async Task<IActionResult> UserPhotos([FromQuery] string user)
|
||||||
{
|
{
|
||||||
User? userFromQuery = await this.database.Users.FirstOrDefaultAsync(u => u.Username == user);
|
User? userFromQuery = await this.database.Users.FirstOrDefaultAsync(u => u.Username == user);
|
||||||
|
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
|
||||||
if (user == null) return this.NotFound();
|
if (user == null) return this.NotFound();
|
||||||
|
|
||||||
List<Photo> photos = await this.database.Photos.Where(p => p.CreatorId == userFromQuery.UserId).Take(10).ToListAsync();
|
List<Photo> photos = await this.database.Photos.Where(p => p.CreatorId == userFromQuery.UserId).Take(10).ToListAsync();
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#nullable enable
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue