mirror of
				https://github.com/zoriya/Kyoo.git
				synced 2025-11-04 03:27:14 -05:00 
			
		
		
		
	Solving a bug with the account update method
This commit is contained in:
		
							parent
							
								
									eb132c2da2
								
							
						
					
					
						commit
						eb37ec7d1b
					
				@ -31,11 +31,11 @@ namespace Kyoo.Api
 | 
				
			|||||||
	
 | 
						
 | 
				
			||||||
	public class AccountData
 | 
						public class AccountData
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		[FromQuery(Name = "email")]
 | 
							[FromForm(Name = "email")]
 | 
				
			||||||
		public string Email { get; set; }
 | 
							public string Email { get; set; }
 | 
				
			||||||
		[FromQuery(Name = "username")]
 | 
							[FromForm(Name = "username")]
 | 
				
			||||||
		public string Username { get; set; }
 | 
							public string Username { get; set; }
 | 
				
			||||||
		[FromQuery(Name = "picture")]
 | 
							[FromForm(Name = "picture")]
 | 
				
			||||||
		public IFormFile Picture { get; set; }
 | 
							public IFormFile Picture { get; set; }
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
@ -116,7 +116,10 @@ namespace Kyoo.Api
 | 
				
			|||||||
			User user = await _userManager.FindByNameAsync(username);
 | 
								User user = await _userManager.FindByNameAsync(username);
 | 
				
			||||||
			if (user == null)
 | 
								if (user == null)
 | 
				
			||||||
				return BadRequest();
 | 
									return BadRequest();
 | 
				
			||||||
			return new PhysicalFileResult(Path.Combine(_picturePath, user.Id), "image/png");
 | 
								string path = Path.Combine(_picturePath, user.Id);
 | 
				
			||||||
 | 
								if (!System.IO.File.Exists(path))
 | 
				
			||||||
 | 
									return NotFound();
 | 
				
			||||||
 | 
								return new PhysicalFileResult(path, "image");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		[HttpPost("update")]
 | 
							[HttpPost("update")]
 | 
				
			||||||
 | 
				
			|||||||
@ -1 +1 @@
 | 
				
			|||||||
Subproject commit 044132d4bf052f61c99186258e9aaf6da571b4ca
 | 
					Subproject commit 54f9406c079894648b9a84a63aa7944c8d439ce4
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user