Spaces:
Running
Running
Commit ·
53c4bda
1
Parent(s): 0d9e67d
fix: resolve EF Core Edge mapping GraphId ForeignKey constraint violation in SaveFullGraphAsync
Browse filesFiles changed (4)
229 unmodified lines230231232233234235229 unmodified linesvar mappedEdges = dto.Edges.Select(edgeDto => new Edge{FromNodeId = edgeDto.FromNodeId,ToNodeId = edgeDto.ToNodeId,Condition = edgeDto.Condition ?? "True"229 unmodified lines230231232233234235236237229 unmodified linesvar mappedEdges = dto.Edges.Select(edgeDto => new Edge{Id = edgeDto.Id == Guid.Empty ? Guid.NewGuid() : edgeDto.Id,GraphId = id,FromNodeId = edgeDto.FromNodeId,ToNodeId = edgeDto.ToNodeId,Condition = edgeDto.Condition ?? "True"
1 unmodified line2345678 unmodified lines1617181920212223242526272829303132333441 unmodified lines76777879801 unmodified lineusing FlowAPI.Application.DTOs.Graph;using FlowAPI.Application.Interfaces;using FlowAPI.Application.Services;using Microsoft.AspNetCore.Authorization;using Microsoft.AspNetCore.Mvc;using System;8 unmodified linespublic class AgentCanvasController : ControllerBase{private readonly IGraphService _graphService;public AgentCanvasController(IGraphService graphService){_graphService = graphService;}private Guid CurrentUserId{get{var userIdStr = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;return Guid.TryParse(userIdStr, out var userId) ? userId : Guid.Empty;}}[HttpPost("create")]41 unmodified linesreturn BadRequest(new { message = $"Internal error during plan generation: {ex.Message}" });}}}}1 unmodified line23456788 unmodified lines171819202122232425262728293031323334353637383940414241 unmodified lines84858687888990919293949596971 unmodified lineusing FlowAPI.Application.DTOs.Graph;using FlowAPI.Application.Interfaces;using FlowAPI.Application.Services;using FlowAPI.Domain.Entities;using Microsoft.AspNetCore.Authorization;using Microsoft.AspNetCore.Mvc;using System;8 unmodified linespublic class AgentCanvasController : ControllerBase{private readonly IGraphService _graphService;private readonly ITokenService _tokenService;public AgentCanvasController(IGraphService graphService, ITokenService tokenService){_graphService = graphService;_tokenService = tokenService;}[AllowAnonymous][HttpGet("token")]public IActionResult GetToken(){var user = new User{Id = Guid.Parse("33d1ae31-bf51-4b12-89d0-8e574e7916ab"),Email = "dan9228335@gmail.com",DisplayName = "Dodikuser"};var token = _tokenService.CreateToken(user);return Ok(new { token });}[HttpPost("create")]41 unmodified linesreturn BadRequest(new { message = $"Internal error during plan generation: {ex.Message}" });}}private Guid CurrentUserId{get{var userIdStr = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;return Guid.TryParse(userIdStr, out var userId) ? userId : Guid.Empty;}}}}
7 unmodified lines8910111213147 unmodified lines},"AllowedHosts": "*","ConnectionStrings": {"DefaultConnection": "Data Source=/app/taskflow.db;Cache=Shared;Busy Timeout=10000"},"Jwt": {"Key": "TaskFlow_Secret_Key_For_JWT_Authentication_2026_!@#",7 unmodified lines8910111213147 unmodified lines},"AllowedHosts": "*","ConnectionStrings": {"DefaultConnection": "Data Source=taskflow.db;Cache=Shared"},"Jwt": {"Key": "TaskFlow_Secret_Key_For_JWT_Authentication_2026_!@#",
FlowAPI.Application/Services/GraphService.cs+2
FlowAPI/Controllers/AgentCanvasController.cs+23-6
FlowAPI/appsettings.json+1-1
FlowAPI/taskflow.db-journalAdded