Add SuccessToast component and pinLogo asset***

***Update saveEdit function in adventureService.ts***
***Remove unnecessary buttons in Navbar.svelte***
***Add EditModal component***
***Update Footer.svelte with pinLogo and copyright information
This commit is contained in:
Sean Morley
2024-03-31 00:49:42 +00:00
parent 960062b499
commit bf640bc433
7 changed files with 133 additions and 39 deletions

View File

@@ -41,12 +41,18 @@ export function removeAdventure(event: { detail: number; }) {
}
}
export function saveEdit(editId:number, editName:string, editLocation:string, editCreated:string) {
const adventure = adventures.find(adventure => adventure.id === editId);
if (adventure) {
adventure.name = editName;
adventure.location = editLocation;
adventure.created = editCreated;
export function saveEdit(adventure:Adventure) {
let editId = adventure.id;
console.log("saving edit")
let editName = adventure.name;
let editLocation = adventure.location;
let editCreated = adventure.created;
let oldAdventure: Adventure | undefined = adventures.find(adventure => adventure.id === editId);
console.log("old" + oldAdventure)
if (oldAdventure) {
oldAdventure.name = editName;
oldAdventure.location = editLocation;
oldAdventure.created = editCreated;
}
editId = NaN;
console.log("done")