sync code

This commit is contained in:
2023-06-26 22:33:44 +08:00
parent 2d87e50dd0
commit 4bf330f824
26 changed files with 2644 additions and 62 deletions

View File

@@ -3,7 +3,6 @@ using Blahblah.FlowerStory.Server.Data.Model;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.IO;
namespace Blahblah.FlowerStory.Server.Controller;
@@ -294,7 +293,7 @@ public class EventApiController : BaseController
var record = database.Records.SingleOrDefault(r => r.Id == update.Id && r.OwnerId == user.Id);
if (record == null)
{
return NotFound(update.Id);
return NotFound($"Event id {update.Id} not found");
}
record.FlowerId = update.FlowerId;
record.EventId = update.EventId;
@@ -365,7 +364,7 @@ public class EventApiController : BaseController
var record = database.Records.SingleOrDefault(r => r.Id == id && r.OwnerId == user.Id);
if (record == null)
{
return NotFound(id);
return NotFound($"Record id {id} not found");
}
if (photo.Length > 0)
{
@@ -458,7 +457,7 @@ public class EventApiController : BaseController
var record = database.Records.SingleOrDefault(r => r.Id == id && r.OwnerId == user.Id);
if (record == null)
{
return NotFound(id);
return NotFound($"Record id {id} not found");
}
SaveDatabase();