Skip to content

Commit

Permalink
fixed update habit htmx strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
believelody authored and billybillydev committed Aug 13, 2024
1 parent 1a17dbe commit 32b7df9
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/controllers/api/habits.api.controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,18 @@ export const habitIdApiController = new Hono<{ Variables: AppVariables }>()
}

return html(
<HabitItem
item={updatedHabit}
x-notification={{
type: "success",
message: "Habit updated successfully",
}}
/>
<>
<span
x-init={`
$notify(${JSON.stringify({
type: "success",
message: "Habit updated successfully",
})});
$el.remove();
`}
/>
<HabitItem item={updatedHabit} />
</>
);
}
)
Expand Down

0 comments on commit 32b7df9

Please sign in to comment.