This commit is contained in:
Egor Aristov 2025-05-07 04:13:00 +03:00
parent 5eab39f1c3
commit a839d87ee6
Signed by: egor3f
GPG Key ID: 40482A264AAEC85F

View File

@ -22,8 +22,8 @@ export const useWizardStore = defineStore('wizard', () => {
localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(specs));
}, 100);
function updateSpec(fieldName: keyof Specs, newValue: SpecValue) {
(specs as Record<keyof Specs, SpecValue>)[fieldName] = newValue;
function updateSpec<K extends keyof Specs>(fieldName: K, newValue: Specs[K]) {
specs[fieldName] = newValue;
updateLocalStorage();
}
function updateSpecs(newValue: Specs) {