mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat(rpc): add msearch type handler
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
9fef8b0611
commit
05e6cfca62
2 changed files with 32 additions and 15 deletions
|
@ -101,12 +101,6 @@ class RPC:
|
|||
if self.type not in RPC.EXPOSED_TYPES:
|
||||
raise RPCError("Incorrect request type specified.")
|
||||
|
||||
try:
|
||||
getattr(self, f"_handle_{self.type.replace('-', '_')}_type")
|
||||
except AttributeError:
|
||||
raise RPCError(
|
||||
f"Request type '{self.type}' is not yet implemented.")
|
||||
|
||||
def _enforce_args(self, args: List[str]):
|
||||
if not args:
|
||||
raise RPCError("No request type/data specified.")
|
||||
|
@ -211,6 +205,9 @@ class RPC:
|
|||
results = search.results().limit(max_results)
|
||||
return [self._get_json_data(pkg) for pkg in results]
|
||||
|
||||
def _handle_msearch_type(self, args: List[str] = [], **kwargs):
|
||||
return self._handle_search_type(by="m", args=args)
|
||||
|
||||
def _handle_suggest_type(self, args: List[str] = [], **kwargs):
|
||||
if not args:
|
||||
return []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue