1
0
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:
Justin Baur
2022-02-07 10:28:11 -05:00
committed by GitHub
parent f56d2ecae5
commit b1cd42e394
2 changed files with 63 additions and 2 deletions

View File

@ -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);
}