mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-02 19:55:18 +02:00
Refactor getAdventures and removeAdventure in log page
This commit is contained in:
parent
ea79fd2d76
commit
fe042f3a5b
1 changed files with 6 additions and 1 deletions
|
@ -61,14 +61,19 @@
|
|||
};
|
||||
|
||||
onMount(async () => {
|
||||
adventures = getAdventures();
|
||||
// adventures = getAdventures();
|
||||
console.log(data.result);
|
||||
adventures = data.result.adventures;
|
||||
});
|
||||
|
||||
function triggerRemoveAdventure(event: { detail: number }) {
|
||||
removeAdventure(event);
|
||||
showToast("removed");
|
||||
adventures = getAdventures();
|
||||
// remove from data.result.adventures
|
||||
data.result.adventures = data.result.adventures.filter(
|
||||
(adventure: Adventure) => adventure.id !== event.detail
|
||||
);
|
||||
}
|
||||
|
||||
function saveAdventure(event: { detail: Adventure }) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue