20 lines
650 B
C#
20 lines
650 B
C#
|
|
using System.Collections.Specialized;
|
||
|
|
using System.Text.Json;
|
||
|
|
|
||
|
|
namespace TeamsISO.App.Services;
|
||
|
|
|
||
|
|
// /notes/* route handlers — append-only operator show-notes file.
|
||
|
|
//
|
||
|
|
// POST /notes (body: { "text": "..." }) → AppendNote
|
||
|
|
public sealed partial class ControlSurfaceServer
|
||
|
|
{
|
||
|
|
private object AppendNote(JsonElement body, NameValueCollection query)
|
||
|
|
{
|
||
|
|
var text = TryGetString(body, query, "text");
|
||
|
|
if (string.IsNullOrWhiteSpace(text))
|
||
|
|
return new { ok = false, error = "text required" };
|
||
|
|
var ok = NotesService.Append(text);
|
||
|
|
return new { ok, action = "note", path = NotesService.TodayPath };
|
||
|
|
}
|
||
|
|
}
|