Fixing episode & library's repository

This commit is contained in:
Zoe Roux
2021-03-16 09:49:48 +01:00
parent 2317445053
commit 28bb719b06
4 changed files with 22 additions and 21 deletions
+2 -1
View File
@@ -171,6 +171,7 @@ namespace Kyoo.Controllers
if (resetOld)
Utility.Nullify(old);
Utility.Complete(old, edited, x => x.GetCustomAttribute<EditableRelationAttribute>() != null);
await Validate(old);
await Database.SaveChangesAsync();
return old;
}
@@ -185,7 +186,7 @@ namespace Kyoo.Controllers
return Validate(resource);
}
private Task Validate(T resource)
protected virtual Task Validate(T resource)
{
if (string.IsNullOrEmpty(resource.Slug))
throw new ArgumentException("Resource can't have null as a slug.");