mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-09-30 12:39:42 +02:00
fix: case selection not persisting across page refresh (#49)
Thank you for the clean fix! The root cause analysis in the PR description was excellent — the strict Zod schema rejecting modelConfig during the GET-then-PUT pattern was a subtle bug.
This commit is contained in:
@@ -109,16 +109,10 @@ Object.assign(CodemanApp.prototype, {
|
||||
|
||||
async saveLastUsedCase(caseName) {
|
||||
try {
|
||||
// Get current settings
|
||||
const res = await fetch('/api/settings');
|
||||
const settings = res.ok ? await res.json() : {};
|
||||
// Update lastUsedCase
|
||||
settings.lastUsedCase = caseName;
|
||||
// Save back
|
||||
await fetch('/api/settings', {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(settings)
|
||||
body: JSON.stringify({ lastUsedCase: caseName })
|
||||
});
|
||||
} catch (err) {
|
||||
console.error('Failed to save last used case:', err);
|
||||
|
||||
Reference in New Issue
Block a user