Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/push-continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ on:
integration_test_ref:
description: 'Integration testing repository git commit hash or branch'
required: true
default: 'dfdcd948cbc6d6bbd2db6620d8499bc8698843e3'
default: 'dev'

env:
INTEGRATION_TEST_REPOSITORY: ${{ github.event.inputs.integration_test_repository || 'psilabs-dev/aio-lanraragi' }}
INTEGRATION_TEST_REF: ${{ github.event.inputs.integration_test_ref || 'dfdcd948cbc6d6bbd2db6620d8499bc8698843e3' }}
INTEGRATION_TEST_REF: ${{ github.event.inputs.integration_test_ref || 'dev' }}

name: "Continuous Integration \U0001F44C\U0001F440"
jobs:
Expand Down Expand Up @@ -93,8 +93,9 @@ jobs:
--image lanraragi:ci \
--staging "$GITHUB_WORKSPACE/staging" \
--playwright \
--dev search \
--npseed 42 \
-k "not test_double_page_navigation and not test_handler_resource_management"
-k "not test_double_page_navigation and not test_handler_resource_management and not test_header_click_sort and not test_compact_column_sort_with_three_columns and not test_custom_column_sort_display"
env:
DOCKER_HOST: unix:///var/run/docker.sock

Expand Down Expand Up @@ -223,5 +224,6 @@ jobs:
--windist "$env:GITHUB_WORKSPACE\LANraragi\win-dist" `
--staging "$env:GITHUB_WORKSPACE\staging" `
--playwright `
--dev search `
--npseed 42 `
-k "not test_double_page_navigation and not test_handler_resource_management"
-k "not test_double_page_navigation and not test_handler_resource_management and not test_header_click_sort and not test_compact_column_sort_with_three_columns and not test_custom_column_sort_display"
30 changes: 30 additions & 0 deletions lib/LANraragi/Controller/Api/Search.pm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,36 @@ sub handle_api {
}
}

# Composite search API with multi-clause OR support.
sub handle_composite {

my $self = shift->openapi->valid_input or return;
my $body = $self->req->json;

my $clauses_raw = $body->{clauses};
my $start = $body->{start} // 0;
my $sortkey = $body->{sortby};
my $sortorder = ( $body->{order} && $body->{order} eq 'desc' ) ? 1 : 0;
my $grouptanks = $body->{groupby_tanks} // 1;

my ( $total, $filtered, @ids ) = LANraragi::Model::Search::do_composite_search(
$clauses_raw, $start, $sortkey, $sortorder, $grouptanks ? 1 : 0
);

if ( $total eq -1 && $filtered eq -1 ) {
$self->render(
openapi => {
recordsTotal => 0,
recordsFiltered => 0,
data => []
},
status => 204
);
} else {
$self->render( openapi => get_api_object( $total, $filtered, @ids ) );
}
}

sub clear_cache {
invalidate_cache();
render_api_response( shift, "clear_cache" );
Expand Down
Loading