refactor(frontend): ApiError interface, tempIdSuffix rename, NET_GRID constants, extract onPaletteDrop handlers
ApiError: defined once in utils/api.ts, replaces 9 ad-hoc anonymous casts
across MazeNET, Inspector, DeckyFleet, SwarmHosts, Webhooks, PersonaGeneration,
ServiceConfigFields, CanaryTokens.
hex4 renamed to tempIdSuffix — the name now matches the comment that already
explained its purpose.
NET_GRID_{W,H,GAP,COLS} extracted from inline magic numbers to module-level
constants in MazeNET.tsx.
onPaletteDrop (130-line useCallback) split into three module-level handlers
(_dropNetwork, _dropArchetype, _dropService); the callback becomes a 10-line
router.
This commit is contained in:
@@ -24,3 +24,9 @@ api.interceptors.response.use(
|
||||
);
|
||||
|
||||
export default api;
|
||||
|
||||
/** Shape of an axios error response from the DECNET API. */
|
||||
export interface ApiError {
|
||||
response?: { status?: number; data?: { detail?: string } };
|
||||
message?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user