From 08d9b9d95085356f5e47e618361f59593d906a99 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 10 Jan 2024 19:30:30 +0100 Subject: [PATCH] Fix patch for direct values --- back/src/Kyoo.Abstractions/Models/Patch.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/back/src/Kyoo.Abstractions/Models/Patch.cs b/back/src/Kyoo.Abstractions/Models/Patch.cs index 608b3f61..305a76fb 100644 --- a/back/src/Kyoo.Abstractions/Models/Patch.cs +++ b/back/src/Kyoo.Abstractions/Models/Patch.cs @@ -24,7 +24,7 @@ using Newtonsoft.Json.Linq; namespace Kyoo.Models; -public class Patch : Dictionary +public class Patch : Dictionary where T : class, IResource { public Guid? Id => this.GetValueOrDefault(nameof(IResource.Id))?.ToObject(); @@ -33,7 +33,7 @@ public class Patch : Dictionary public T Apply(T current) { - foreach ((string property, JObject value) in this) + foreach ((string property, JToken value) in this) { PropertyInfo prop = typeof(T).GetProperty( property,