Refactor evaluation submission logic to directly handle state updates and save changes immediately upon submission
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 1m48s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 1m48s
This commit is contained in:
@@ -333,8 +333,9 @@ export default function EvaluationDetailPage() {
|
|||||||
<div className="flex flex-wrap gap-3">
|
<div className="flex flex-wrap gap-3">
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setEvaluation((e) => (e ? { ...e, status: "submitted" } : null));
|
const updated = evaluation ? { ...evaluation, status: "submitted" } : null;
|
||||||
setTimeout(handleSave, 0);
|
setEvaluation(updated);
|
||||||
|
if (updated) handleSave(updated);
|
||||||
}}
|
}}
|
||||||
className="rounded border border-emerald-500/50 bg-emerald-500/20 px-3 py-1.5 font-mono text-xs text-emerald-600 dark:text-emerald-400 hover:bg-emerald-500/30"
|
className="rounded border border-emerald-500/50 bg-emerald-500/20 px-3 py-1.5 font-mono text-xs text-emerald-600 dark:text-emerald-400 hover:bg-emerald-500/30"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user