Skip to content

Commit

Permalink
[Journal] Add support for notes update
Browse files Browse the repository at this point in the history
  • Loading branch information
zapadi committed Oct 2, 2023
1 parent 85fec9b commit 314ddac
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/redmine-net-api/RedmineManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
};

/// <summary>
Expand Down
18 changes: 17 additions & 1 deletion src/redmine-net-api/Types/Journal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ public sealed class Journal : Identifiable<Journal>
/// <value>
/// The notes.
/// </value>
public string Notes { get; internal set; }
/// <remarks> Setting Notes to string.empty or null will destroy the journal
/// </remarks>
public string Notes { get; set; }

/// <summary>
/// Gets or sets the created on.
Expand Down Expand Up @@ -101,6 +103,13 @@ public override void ReadXml(XmlReader reader)
}
}
}

/// <inheritdoc />
public override void WriteXml(XmlWriter writer)
{
writer.WriteElementString(RedmineKeys.NOTES, Notes);
}

#endregion

#region Implementation of IJsonSerialization
Expand Down Expand Up @@ -136,6 +145,13 @@ public override void ReadJson(JsonReader reader)
}
}
}

/// <inheritdoc />
public override void WriteJson(JsonWriter writer)
{
writer.WriteProperty(RedmineKeys.NOTES, Notes);
}

#endregion

#region Implementation of IEquatable<Journal>
Expand Down

0 comments on commit 314ddac

Please sign in to comment.