1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-20 21:39:37 +02:00

refactor: Add user prop to TransportationCard component for conditional rendering of actions

This commit is contained in:
Sean Morley 2024-07-29 19:19:24 -04:00
parent d5c5551ce1
commit 103500b5e1
3 changed files with 24 additions and 13 deletions

View file

@ -56,10 +56,16 @@
let id = data[1];
let user_id = data[2];
console.log(newCollection);
dispatch('create', newCollection);
addToast('success', 'Collection created successfully!');
close();
if (id !== undefined && user_id !== undefined) {
newCollection.id = id;
newCollection.user_id = user_id;
console.log(newCollection);
dispatch('create', newCollection);
addToast('success', 'Collection created successfully!');
close();
} else {
addToast('error', 'Error creating collection');
}
}
}
}