mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-10 15:32:37 -07:00
Some error handling and ensure we are an admin to delete requests.
Also started on the approval of everything
This commit is contained in:
parent
2935bee30d
commit
0942bfcbcc
18 changed files with 436 additions and 58 deletions
|
@ -30,6 +30,10 @@ using System.Linq;
|
|||
|
||||
using Dapper.Contrib.Extensions;
|
||||
|
||||
using NLog;
|
||||
|
||||
using PlexRequests.Helpers;
|
||||
|
||||
namespace PlexRequests.Store
|
||||
{
|
||||
public class GenericRepository<T> : IRepository<T> where T : Entity
|
||||
|
@ -39,6 +43,8 @@ namespace PlexRequests.Store
|
|||
Config = config;
|
||||
}
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private ISqliteConfiguration Config { get; set; }
|
||||
public long Insert(T entity)
|
||||
{
|
||||
|
@ -84,6 +90,8 @@ namespace PlexRequests.Store
|
|||
|
||||
public bool Update(T entity)
|
||||
{
|
||||
Log.Trace("Updating entity");
|
||||
Log.Trace(entity.DumpJson());
|
||||
using (var db = Config.DbConnection())
|
||||
{
|
||||
db.Open();
|
||||
|
@ -93,7 +101,9 @@ namespace PlexRequests.Store
|
|||
|
||||
public bool UpdateAll(IEnumerable<T> entity)
|
||||
{
|
||||
Log.Trace("Updating all entities");
|
||||
var result = new HashSet<bool>();
|
||||
|
||||
using (var db = Config.DbConnection())
|
||||
{
|
||||
db.Open();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue