{"data":{"exception":"DbUpdateException","message":"An error occurred while saving the entity changes. See the inner exception for details.","helpLink":null,"data":{},"source":"Microsoft.EntityFrameworkCore.Relational","stackTrace":" at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)\n at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)\n at Redsand.Site.Data.ApplicationDbContext.SaveChangesAsync(String caller, String file) in D:\\WORKSPACE\\ECRM-NOBI-R2\\NobiV2\\Data\\ApplicationDbContext.cs:line 257\n at Redsand.Site.Api.CustomerTagController.SetTag(Int32 id, TagBody body) in D:\\WORKSPACE\\ECRM-NOBI-R2\\NobiV2\\Api\\Tags\\CustomerTagController.cs:line 61\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)","inner":{"exception":"PostgresException","message":"23505: duplicate key value violates unique constraint \"PK_CustomerTags\"\n\nDETAIL: Detail redacted as it may contain sensitive data. Specify 'Include Error Detail' in the connection string to include this information.","helpLink":null,"data":{"severity":"ERROR","invariantSeverity":"ERROR","sqlState":"23505","messageText":"duplicate key value violates unique constraint \"PK_CustomerTags\"","detail":"Detail redacted as it may contain sensitive data. Specify 'Include Error Detail' in the connection string to include this information.","schemaName":"public","tableName":"CustomerTags","constraintName":"PK_CustomerTags","file":"nbtinsert.c","line":"673","routine":"_bt_check_unique"},"source":"Npgsql","stackTrace":" at Npgsql.Internal.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|223_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)\n at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)\n at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)\n at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)\n at Npgsql.NpgsqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)","inner":null}},"status":400,"statusText":"","headers":{"access-control-allow-origin":"*","cache-control":"no-store","content-type":"application/json; charset=utf-8","date":"Thu, 18 Dec 2025 05:03:12 GMT","expires":"0","pragma":"no-cache","server":"nginx/1.28.0"},"config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http","fetch"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json","Content-Type":"application/json","Authorization":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6IjExMiIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL25hbWUiOiJraWV1dHJhbmciLCJBc3BOZXQuSWRlbnRpdHkuU2VjdXJpdHlTdGFtcCI6Ilc3QUdCR1pWNTRWM1hZQ0VMVFQ0SUJQRTVWWlFPWjVNIiwic3ViIjoia2lldXRyYW5nIiwianRpIjoiMzA5YjkzNzMtZmFlOC00M2U0LTk2ZDktNzNmNTIwYmZhNGU3IiwiaWF0IjoxNzY2MDM0MTUwLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOiIzLXRlbGVzYWxlIiwibmJmIjoxNzY2MDM0MTUwLCJleHAiOjE3NjYxMjA1NTAsImlzcyI6IlJTIiwiYXVkIjoiUlMifQ.9TDUnjQtIcSkLLDMa6SDUBP_9v4OSEbe9A2WDhQpC6U","ContentType":"application/json","x-hour-offset":"7","BranchId":"1","Locale":"vi"},"baseURL":"https://nguyenanh.nobi.pro","paramsSerializer":{},"method":"post","url":"/api/tags/customer/293930","data":"{\"id\":48,\"color\":\"#d7e645\",\"name\":\"CTC\",\"order\":6,\"createDate\":\"2023-04-11T04:20:02.844218Z\",\"type\":1,\"platforms\":null,\"userId\":2,\"oaId\":null,\"creator\":null,\"zaloOa\":null,\"orders\":null,\"customers\":null,\"conversationTags\":null,\"zaloConversationTags\":null,\"shopeeTags\":null,\"shopeeShopTags\":[],\"orderEcommerces\":null,\"tagged\":false}"},"request":{}}