diff --git a/src/Zammad.Client/OrganizationClient.cs b/src/Zammad.Client/OrganizationClient.cs index 6a6e5eb..a426775 100644 --- a/src/Zammad.Client/OrganizationClient.cs +++ b/src/Zammad.Client/OrganizationClient.cs @@ -31,6 +31,11 @@ public Task> SearchOrganizationAsync(string query, int limit return GetAsync>("/api/v1/organizations/search", $"query={query}&limit={limit}&expand=true"); } + public Task> SearchOrganizationAsync(string query, int limit, string sortBy, string orderBy) + { + return GetAsync>("/api/v1/organizations/search", $"query={query}&limit={limit}&expand=true&sort_by={sortBy}&order_by={orderBy}"); + } + public Task GetOrganizationAsync(int id) { return GetAsync($"/api/v1/organizations/{id}"); diff --git a/src/Zammad.Client/Services/IOrganizationService.cs b/src/Zammad.Client/Services/IOrganizationService.cs index acc745f..fcd1da0 100644 --- a/src/Zammad.Client/Services/IOrganizationService.cs +++ b/src/Zammad.Client/Services/IOrganizationService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; using Zammad.Client.Resources; @@ -9,6 +9,7 @@ public interface IOrganizationService Task> GetOrganizationListAsync(); Task> GetOrganizationListAsync(int page, int count); Task> SearchOrganizationAsync(string query, int limit); + Task> SearchOrganizationAsync(string query, int limit, string sortBy, string orderBy); Task GetOrganizationAsync(int id); Task CreateOrganizationAsync(Organization organization); Task UpdateOrganizationAsync(int id, Organization organization); diff --git a/src/Zammad.Client/Services/ITicketService.cs b/src/Zammad.Client/Services/ITicketService.cs index 38674c4..5d96aa8 100644 --- a/src/Zammad.Client/Services/ITicketService.cs +++ b/src/Zammad.Client/Services/ITicketService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; using Zammad.Client.Resources; @@ -9,6 +9,7 @@ public interface ITicketService Task> GetTicketListAsync(); Task> GetTicketListAsync(int page, int count); Task> SearchTicketAsync(string query, int limit); + Task> SearchTicketAsync(string query, int limit, string sortBy, string orderBy); Task GetTicketAsync(int id); Task CreateTicketAsync(Ticket ticket, TicketArticle article); Task UpdateTicketAsync(int id, Ticket ticket); diff --git a/src/Zammad.Client/Services/IUserService.cs b/src/Zammad.Client/Services/IUserService.cs index 89606f8..947d22c 100644 --- a/src/Zammad.Client/Services/IUserService.cs +++ b/src/Zammad.Client/Services/IUserService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; using Zammad.Client.Resources; @@ -10,6 +10,7 @@ public interface IUserService Task> GetUserListAsync(); Task> GetUserListAsync(int page, int count); Task> SearchUserAsync(string query, int limit); + Task> SearchUserAsync(string query, int limit, string sortBy, string orderBy); Task GetUserAsync(int id); Task CreateUserAsync(User user); Task UpdateUserAsync(int id, User user); diff --git a/src/Zammad.Client/TicketClient.cs b/src/Zammad.Client/TicketClient.cs index 14b3eeb..be7aaab 100644 --- a/src/Zammad.Client/TicketClient.cs +++ b/src/Zammad.Client/TicketClient.cs @@ -33,6 +33,11 @@ public Task> SearchTicketAsync(string query, int limit) return GetAsync>("/api/v1/tickets/search", $"query={query}&limit={limit}&expand=true"); } + public Task> SearchTicketAsync(string query, int limit, string sortBy, string orderBy) + { + return GetAsync>("/api/v1/tickets/search", $"query={query}&limit={limit}&expand=true&sort_by={sortBy}&order_by={orderBy}"); + } + public Task GetTicketAsync(int id) { return GetAsync($"/api/v1/tickets/{id}"); diff --git a/src/Zammad.Client/UserClient.cs b/src/Zammad.Client/UserClient.cs index 42eafab..9fa8d85 100644 --- a/src/Zammad.Client/UserClient.cs +++ b/src/Zammad.Client/UserClient.cs @@ -36,6 +36,11 @@ public Task> SearchUserAsync(string query, int limit) return GetAsync>("/api/v1/users/search", $"query={query}&limit={limit}&expand=true"); } + public Task> SearchUserAsync(string query, int limit, string sortBy, string orderBy) + { + return GetAsync>("/api/v1/users/search", $"query={query}&limit={limit}&expand=true&sort_by={sortBy}&order_by={orderBy}"); + } + public Task GetUserAsync(int id) { return GetAsync($"/api/v1/users/{id}");