[Feature request] transfer trip ownership #973
-
Use caseTrips are often planned by one family/group member but logged by another, and over time the "owner of record" should be able to change without losing data. A few concrete scenarios:
Current behaviorLooking at
The combination means there is no path — UI, API, or otherwise — to keep trip data alive while changing who owns it. Proposed behaviorAdd a router.post('/:id/transfer', authenticate, (req, res) => {
const { newOwnerId } = req.body;
const access = canAccessTrip(req.params.id, authReq.user.id);
if (!access || access.user_id !== authReq.user.id)
return res.status(403).json({ error: 'Only the current owner can transfer this trip' });
// newOwnerId must be an existing member
const isMember = db.prepare(
'SELECT 1 FROM trip_members WHERE trip_id = ? AND user_id = ?'
).get(req.params.id, newOwnerId);
if (!isMember) return res.status(400).json({ error: 'New owner must be a current trip member' });
// Transfer in a transaction:
// 1. UPDATE trips SET user_id = ? WHERE id = ?
// 2. DELETE the new-owner row from trip_members (since owner isn't in that table)
// 3. INSERT the previous owner into trip_members (so they stay on the trip as a member)
// ...
});Companion UI surface: an extra option in the trip's settings/members panel, visible only to the current owner — "Transfer ownership to ___ (member)". Considerations
Optional follow-up: graceful account deletionThe cascade-delete behavior of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
You can now transfer a trip to another member from the share dialog — the new owner takes over and you stay on as a member. Shipping in 3.2.0. Thanks for the request! |
Beta Was this translation helpful? Give feedback.
You can now transfer a trip to another member from the share dialog — the new owner takes over and you stay on as a member. Shipping in 3.2.0. Thanks for the request!