Vibe deck UI and hiding notes UI for now
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Chrono.Model;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Server.Controllers;
|
||||
|
||||
@@ -21,10 +20,7 @@ public class NotesController : ControllerBase
|
||||
try
|
||||
{
|
||||
var note = await _context.CardNotes.FindAsync(cardName);
|
||||
if (note == null)
|
||||
{
|
||||
return Ok(new CardNote { CardName = cardName, Note = "" });
|
||||
}
|
||||
if (note == null) return Ok(new CardNote { CardName = cardName, Note = "" });
|
||||
return Ok(note);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -41,13 +37,9 @@ public class NotesController : ControllerBase
|
||||
{
|
||||
var existing = await _context.CardNotes.FindAsync(note.CardName);
|
||||
if (existing == null)
|
||||
{
|
||||
_context.CardNotes.Add(note);
|
||||
}
|
||||
else
|
||||
{
|
||||
existing.Note = note.Note;
|
||||
}
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
@@ -55,7 +47,7 @@ public class NotesController : ControllerBase
|
||||
{
|
||||
Console.WriteLine($"[WARNING] Could not save note to database: {ex.Message}");
|
||||
}
|
||||
|
||||
|
||||
return Ok(note);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user