From 02d9e9e57f86b5536f3aee0de68f7cf42941fc47 Mon Sep 17 00:00:00 2001 From: Tom Tang <4220945+shiba4life@users.noreply.github.com> Date: Tue, 12 May 2026 11:14:03 +0800 Subject: [PATCH] refactor(constants): drop 8 dead SCHEMA_ACTION_TYPES keys + unused SchemaActionType export The synchronous action-type strings duplicated reducer names that Redux Toolkit's createSlice already auto-generates. None of them were referenced anywhere. Likewise SchemaActionType had no importers. Removed keys: SET_ACTIVE_SCHEMA, UPDATE_SCHEMA_STATUS, SET_LOADING, SET_ERROR, CLEAR_ERROR, CLEAR_OPERATION_ERROR, INVALIDATE_CACHE, RESET_SCHEMAS. Kept the 5 thunk types still referenced from schemaSlice.ts and SCHEMA_OPERATION_REQUIREMENTS. Follow-up explicitly carved out as OUT OF SCOPE in PR #1012. --- src/server/static-react/src/constants/redux.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/server/static-react/src/constants/redux.ts b/src/server/static-react/src/constants/redux.ts index ab562234..a7ae4577 100644 --- a/src/server/static-react/src/constants/redux.ts +++ b/src/server/static-react/src/constants/redux.ts @@ -34,30 +34,15 @@ export const SCHEMA_OPERATION_TIMEOUT_MS = 10000; // REDUX ACTION TYPE CONSTANTS // ============================================================================ -/** - * Base action types for schema slice - */ +/** Action types for schema async thunks (RTK auto-generates sync reducer types). */ export const SCHEMA_ACTION_TYPES = { - // Async thunk action types FETCH_SCHEMAS: "schemas/fetchSchemas", APPROVE_SCHEMA: "schemas/approveSchema", BLOCK_SCHEMA: "schemas/blockSchema", UNLOAD_SCHEMA: "schemas/unloadSchema", LOAD_SCHEMA: "schemas/loadSchema", - - // Synchronous action types - SET_ACTIVE_SCHEMA: "schemas/setActiveSchema", - UPDATE_SCHEMA_STATUS: "schemas/updateSchemaStatus", - SET_LOADING: "schemas/setLoading", - SET_ERROR: "schemas/setError", - CLEAR_ERROR: "schemas/clearError", - CLEAR_OPERATION_ERROR: "schemas/clearOperationError", - INVALIDATE_CACHE: "schemas/invalidateCache", - RESET_SCHEMAS: "schemas/resetSchemas", } as const; -export type SchemaActionType = (typeof SCHEMA_ACTION_TYPES)[keyof typeof SCHEMA_ACTION_TYPES]; - // ============================================================================ // DEFAULT STATE VALUES // ============================================================================