From b4319206d8cfe991dfb292d000c8cc3d2ef97cbe Mon Sep 17 00:00:00 2001 From: Padi Date: Tue, 3 Oct 2023 08:22:09 +0000 Subject: [PATCH] [Journal] Add support for notes update (#335) --- src/redmine-net-api/RedmineManager.cs | 3 ++- src/redmine-net-api/Types/Journal.cs | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/redmine-net-api/RedmineManager.cs b/src/redmine-net-api/RedmineManager.cs index 50bd7f60..df24603c 100644 --- a/src/redmine-net-api/RedmineManager.cs +++ b/src/redmine-net-api/RedmineManager.cs @@ -64,7 +64,8 @@ public class RedmineManager : IRedmineManager {typeof(Watcher), "watchers"}, {typeof(IssueCustomField), "custom_fields"}, {typeof(CustomField), "custom_fields"}, - {typeof(Search), "search"} + {typeof(Search), "search"}, + {typeof(Journal), "journals"} }; /// diff --git a/src/redmine-net-api/Types/Journal.cs b/src/redmine-net-api/Types/Journal.cs index 7cee01df..9558fa8a 100644 --- a/src/redmine-net-api/Types/Journal.cs +++ b/src/redmine-net-api/Types/Journal.cs @@ -48,7 +48,9 @@ public sealed class Journal : Identifiable /// /// The notes. /// - public string Notes { get; internal set; } + /// Setting Notes to string.empty or null will destroy the journal + /// + public string Notes { get; set; } /// /// Gets or sets the created on. @@ -101,6 +103,13 @@ public override void ReadXml(XmlReader reader) } } } + + /// + public override void WriteXml(XmlWriter writer) + { + writer.WriteElementString(RedmineKeys.NOTES, Notes); + } + #endregion #region Implementation of IJsonSerialization @@ -136,6 +145,13 @@ public override void ReadJson(JsonReader reader) } } } + + /// + public override void WriteJson(JsonWriter writer) + { + writer.WriteProperty(RedmineKeys.NOTES, Notes); + } + #endregion #region Implementation of IEquatable