From 5b7ad4f2ff29efae303cae9fe8ea4ad296467a17 Mon Sep 17 00:00:00 2001 From: Michele Scandura Date: Thu, 23 Sep 2021 12:47:48 +0100 Subject: [PATCH] fix note bugs --- Sledgemapper.Api/Handlers/NewNoteCommandHandler.cs | 2 +- Sledgemapper.Shared/Entities/Note.cs | 14 +++++++++++++- Sledgemapper/Sledgemapper.cs | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Sledgemapper.Api/Handlers/NewNoteCommandHandler.cs b/Sledgemapper.Api/Handlers/NewNoteCommandHandler.cs index 6390422..8be5287 100644 --- a/Sledgemapper.Api/Handlers/NewNoteCommandHandler.cs +++ b/Sledgemapper.Api/Handlers/NewNoteCommandHandler.cs @@ -18,7 +18,7 @@ namespace Sledgemapper.Api.Handlers { await CheckAuthorization(command); var jsonString = JsonSerializer.Serialize(command.Note); - var session = await SaveLog(command, "N", "W", jsonString, cancellationToken); + var session = await SaveLog(command, "N", "N", jsonString, cancellationToken); await Mediator.Publish(new NewNoteNotification(session, command.Note, command.UserId), cancellationToken); return true; } diff --git a/Sledgemapper.Shared/Entities/Note.cs b/Sledgemapper.Shared/Entities/Note.cs index 6dac5bb..a89257f 100644 --- a/Sledgemapper.Shared/Entities/Note.cs +++ b/Sledgemapper.Shared/Entities/Note.cs @@ -1,9 +1,21 @@ -namespace Sledgemapper.Shared.Entities +namespace Sledgemapper.Shared.Entities { public class Note :BaseMapEntity { + public Note(){} + public Note(Note n) + { + X=n.X; + Y=n.Y; + Text=n.Text; + ID = n.ID; + Rotation = n.Rotation; + Timestamp = n.Timestamp; + + } + public string Text { get; set; } } diff --git a/Sledgemapper/Sledgemapper.cs b/Sledgemapper/Sledgemapper.cs index efec31b..fe3864d 100644 --- a/Sledgemapper/Sledgemapper.cs +++ b/Sledgemapper/Sledgemapper.cs @@ -255,7 +255,7 @@ namespace Sledgemapper else { _sessionData.Notes.TryGetValue(_state.SelectedNote.ToString(), out var n); - _state.SelectedNote = n; + _state.SelectedNote = new Note(n); var viewNoteButton = new TextButton { Text = "View Note", Width = 80, Height = 20, Padding = new Thickness(2),