Merge branch 'dev' of https://github.com/HonesDK/oqtane.framework into dev
This commit is contained in:
@ -15,7 +15,6 @@ namespace Oqtane.Services
|
||||
/// <param name="siteId">ID of a <see cref="Site"/></param>
|
||||
/// <returns></returns>
|
||||
Task<User> GetUserAsync(int userId, int siteId);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a <see cref="User"/> of a specific site
|
||||
@ -25,6 +24,15 @@ namespace Oqtane.Services
|
||||
/// <returns></returns>
|
||||
Task<User> GetUserAsync(string username, int siteId);
|
||||
|
||||
/// <summary>
|
||||
/// Get a <see cref="User"/> of a specific site
|
||||
/// </summary>
|
||||
/// <param name="username">Username / login of a <see cref="User"/></param>
|
||||
/// <param name="email">email address of a <see cref="User"/></param>
|
||||
/// <param name="siteId">ID of a <see cref="Site"/></param>
|
||||
/// <returns></returns>
|
||||
Task<User> GetUserAsync(string username, string email, int siteId);
|
||||
|
||||
/// <summary>
|
||||
/// Save a user to the Database.
|
||||
/// The <see cref="User"/> object contains all the information incl. what <see cref="Site"/> it belongs to.
|
||||
|
@ -4,6 +4,7 @@ using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Oqtane.Documentation;
|
||||
using System.Net;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
@ -21,7 +22,12 @@ namespace Oqtane.Services
|
||||
|
||||
public async Task<User> GetUserAsync(string username, int siteId)
|
||||
{
|
||||
return await GetJsonAsync<User>($"{Apiurl}/name/{username}?siteid={siteId}");
|
||||
return await GetUserAsync(username, "", siteId);
|
||||
}
|
||||
|
||||
public async Task<User> GetUserAsync(string username, string email, int siteId)
|
||||
{
|
||||
return await GetJsonAsync<User>($"{Apiurl}/name/{(!string.IsNullOrEmpty(username) ? username : "-")}/{(!string.IsNullOrEmpty(email) ? email : "-")}/?siteid={siteId}");
|
||||
}
|
||||
|
||||
public async Task<User> AddUserAsync(User user)
|
||||
|
Reference in New Issue
Block a user