mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
Fix json only serializing base properties (#1840)
* Fix json only serializing base properties * Run formatting * Switch to returning concrete type * Update method name
This commit is contained in:
@ -71,7 +71,7 @@ namespace Bit.Api.Models.Request
|
||||
existingSend.Data = JsonSerializer.Serialize(fileData, JsonHelpers.IgnoreWritingNull);
|
||||
break;
|
||||
case SendType.Text:
|
||||
existingSend.Data = JsonSerializer.Serialize(ToSendData(), JsonHelpers.IgnoreWritingNull);
|
||||
existingSend.Data = JsonSerializer.Serialize(ToSendTextData(), JsonHelpers.IgnoreWritingNull);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException("Unsupported type: " + nameof(Type) + ".");
|
||||
@ -128,7 +128,7 @@ namespace Bit.Api.Models.Request
|
||||
return existingSend;
|
||||
}
|
||||
|
||||
private SendData ToSendData()
|
||||
private SendTextData ToSendTextData()
|
||||
{
|
||||
return new SendTextData(Name, Notes, Text.Text, Text.Hidden);
|
||||
}
|
||||
|
Reference in New Issue
Block a user