mirror of
https://github.com/johndoe6345789/postgres.git
synced 2026-04-24 13:55:00 +00:00
fix: TypeScript errors in new components
- Fix potential undefined access in QueryBuilderTab - Fix unused variable in featureConfig test - Add proper undefined checks for array access Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -108,7 +108,9 @@ export default function QueryBuilderTab({
|
||||
value: string,
|
||||
) => {
|
||||
const updated = [...whereConditions];
|
||||
updated[index][field] = value;
|
||||
if (updated[index]) {
|
||||
updated[index][field] = value;
|
||||
}
|
||||
setWhereConditions(updated);
|
||||
};
|
||||
|
||||
|
||||
@@ -90,8 +90,8 @@ describe('FeatureConfig', () => {
|
||||
it('should return undefined for disabled feature', () => {
|
||||
// This test assumes there might be disabled features in the config
|
||||
const features = getFeatures();
|
||||
const enabledIds = features.map(f => f.id);
|
||||
|
||||
const _enabledIds = features.map(f => f.id);
|
||||
|
||||
// Try to get a feature that doesn't exist in enabled list
|
||||
const disabledFeature = getFeatureById('disabled-test-feature');
|
||||
expect(disabledFeature).toBeUndefined();
|
||||
|
||||
Reference in New Issue
Block a user