fix: refresh the prompt editor after a version is set as production (#30233)

This commit is contained in:
G30
2026-09-21 08:31:51 -04:00
committed by GitHub
parent 7f703dcc98
commit 440d13e198
@@ -181,9 +181,15 @@
}
try {
await setProductionPromptVersion(localStorage.token, prompt.id, historyEntry.id);
const res = await setProductionPromptVersion(localStorage.token, prompt.id, historyEntry.id);
// Update local prompt object to trigger reactivity
prompt = { ...prompt, version_id: historyEntry.id };
prompt = { ...prompt, ...(res ?? {}), version_id: historyEntry.id };
name = prompt.name || '';
content = prompt.content ?? '';
tags = (prompt.tags || []).map((tag) => ({ name: tag }));
originalName = name;
originalTags = tags;
toast.success($i18n.t('Production version updated'));
} catch (error) {
toast.error(`${error}`);