API: Fixes for creating new zones

This commit is contained in:
Jon Evans
2024-12-26 13:34:16 -05:00
parent 7b6a344f45
commit 6c47f32ccf
3 changed files with 22 additions and 3 deletions
+3 -3
View File
@@ -343,11 +343,11 @@ HANDLER_RESULT<ItemRequestStatus> API_HANDLER_PCB::handleCreateUpdateItemsIntern
continue;
}
if( aCreate && !board->GetEnabledLayers().Contains( item->GetLayer() ) )
if( aCreate && !( board->GetEnabledLayers() & item->GetLayerSet() ).any() )
{
status.set_code( ItemStatusCode::ISC_INVALID_DATA );
status.set_error_message( fmt::format( "attempted to add item on disabled layer {}",
LayerName( item->GetLayer() ).ToStdString() ) );
status.set_error_message(
"attempted to add item with no overlapping layers with the board" );
aItemHandler( status, anyItem );
continue;
}