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:
parent
d5c5551ce1
commit
103500b5e1
3 changed files with 24 additions and 13 deletions
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue