mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 16:42:50 -05:00
initial commit of source
This commit is contained in:
24
src/Api/Models/Request/Accounts/UpdateProfileRequestModel.cs
Normal file
24
src/Api/Models/Request/Accounts/UpdateProfileRequestModel.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Bit.Core.Domains;
|
||||
|
||||
namespace Bit.Api.Models
|
||||
{
|
||||
public class UpdateProfileRequestModel
|
||||
{
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
public string MasterPasswordHint { get; set; }
|
||||
[Required]
|
||||
[RegularExpression("^[a-z]{2}-[A-Z]{2}$")]
|
||||
public string Culture { get; set; }
|
||||
|
||||
public User ToUser(User existingUser)
|
||||
{
|
||||
existingUser.Name = Name;
|
||||
existingUser.MasterPasswordHint = string.IsNullOrWhiteSpace(MasterPasswordHint) ? null : MasterPasswordHint;
|
||||
existingUser.Culture = Culture;
|
||||
|
||||
return existingUser;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user