-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule-base.js
More file actions
23 lines (20 loc) · 1.29 KB
/
module-base.js
File metadata and controls
23 lines (20 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ─────────────────────────────────────────────────────────────────────────────
CREWKIT — module-base.js
Shared utilities for module pages (framework-builder, team-member).
Must be loaded after validator.js and app.js.
───────────────────────────────────────────────────────────────────────────── */
const ModuleBase = {
/* ── safeSave ──────────────────────────────────────────────────────────────
Runs Validator.validateSetup() before persisting.
Blocks on L1 (errors), allows L2 (warnings).
Returns true if saved, false if blocked. */
safeSave(data) {
const result = Validator.validateSetup(data);
if (result.level === 1) {
Toast.show('Cannot save: setup has validation errors.', 'error');
return false;
}
App.saveToStorage(data);
return true;
},
};