improve validation and exception handling in API Controllers
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@ -9,11 +9,5 @@ namespace Oqtane.Services
|
||||
Task<List<JobLog>> GetJobLogsAsync();
|
||||
|
||||
Task<JobLog> GetJobLogAsync(int jobLogId);
|
||||
|
||||
Task<JobLog> AddJobLogAsync(JobLog jobLog);
|
||||
|
||||
Task<JobLog> UpdateJobLogAsync(JobLog jobLog);
|
||||
|
||||
Task DeleteJobLogAsync(int jobLogId);
|
||||
}
|
||||
}
|
||||
|
@ -21,26 +21,5 @@ namespace Oqtane.Services
|
||||
/// <param name="tenantId">ID-reference of the <see cref="Tenant"/></param>
|
||||
/// <returns></returns>
|
||||
Task<Tenant> GetTenantAsync(int tenantId);
|
||||
|
||||
/// <summary>
|
||||
/// Add / save another <see cref="Tenant"/> to the database
|
||||
/// </summary>
|
||||
/// <param name="tenant">A <see cref="Tenant"/> object containing the configuration</param>
|
||||
/// <returns></returns>
|
||||
Task<Tenant> AddTenantAsync(Tenant tenant);
|
||||
|
||||
/// <summary>
|
||||
/// Update the <see cref="Tenant"/> information in the database.
|
||||
/// </summary>
|
||||
/// <param name="tenant"></param>
|
||||
/// <returns></returns>
|
||||
Task<Tenant> UpdateTenantAsync(Tenant tenant);
|
||||
|
||||
/// <summary>
|
||||
/// Delete / remove a <see cref="Tenant"/>
|
||||
/// </summary>
|
||||
/// <param name="tenantId"></param>
|
||||
/// <returns></returns>
|
||||
Task DeleteTenantAsync(int tenantId);
|
||||
}
|
||||
}
|
||||
|
@ -30,19 +30,5 @@ namespace Oqtane.Services
|
||||
{
|
||||
return await GetJsonAsync<JobLog>($"{Apiurl}/{jobLogId}");
|
||||
}
|
||||
|
||||
public async Task<JobLog> AddJobLogAsync(JobLog joblog)
|
||||
{
|
||||
return await PostJsonAsync<JobLog>(Apiurl, joblog);
|
||||
}
|
||||
|
||||
public async Task<JobLog> UpdateJobLogAsync(JobLog joblog)
|
||||
{
|
||||
return await PutJsonAsync<JobLog>($"{Apiurl}/{joblog.JobLogId}", joblog);
|
||||
}
|
||||
public async Task DeleteJobLogAsync(int jobLogId)
|
||||
{
|
||||
await DeleteAsync($"{Apiurl}/{jobLogId}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,20 +30,5 @@ namespace Oqtane.Services
|
||||
{
|
||||
return await GetJsonAsync<Tenant>($"{Apiurl}/{tenantId}");
|
||||
}
|
||||
|
||||
public async Task<Tenant> AddTenantAsync(Tenant tenant)
|
||||
{
|
||||
return await PostJsonAsync<Tenant>(Apiurl, tenant);
|
||||
}
|
||||
|
||||
public async Task<Tenant> UpdateTenantAsync(Tenant tenant)
|
||||
{
|
||||
return await PutJsonAsync<Tenant>($"{Apiurl}/{tenant.TenantId}", tenant);
|
||||
}
|
||||
|
||||
public async Task DeleteTenantAsync(int tenantId)
|
||||
{
|
||||
await DeleteAsync($"{Apiurl}/{tenantId}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user