Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot] 2026-05-01 11:34:28 +00:00
parent 154647ecf3
commit 4153014638

View file

@ -145,14 +145,14 @@ function SkillDetailPage() {
return data;
},
onSuccess: (data) => {
if (data.no_op) {
if (data?.no_op) {
toast.info("Esta versão já está publicada");
} else if (data.synced === false) {
} else if (data?.synced === false) {
toast.warning(`Versão ${data.version_number} publicada, mas o sync falhou.`, {
description: data.sync_error || "Tente novamente após o próximo deploy.",
});
} else {
toast.success(`Versão ${data.version_number} publicada!`);
toast.success(`Versão ${data?.version_number ?? ""} publicada!`);
}
qc.invalidateQueries({ queryKey: ["skill-versions", id] });
qc.invalidateQueries({ queryKey: ["skill", id] });
@ -181,6 +181,7 @@ function SkillDetailPage() {
toast.success("Skill arquivada");
qc.invalidateQueries({ queryKey: ["skills"] });
qc.invalidateQueries({ queryKey: ["user-limits"] });
if (skill.data?.agent_instance_id) {
void syncAgentSkills(skill.data.agent_instance_id).then(({ error }) => {
if (error) {
toast.warning("Skill arquivada, mas o sync com o container falhou.", {
@ -188,6 +189,7 @@ function SkillDetailPage() {
});
}
});
}
navigate({ to: "/painel/skills" });
},
onError: (e: unknown) => toast.error(e instanceof Error ? e.message : "Erro"),