fix(plugins): trips.getById returns the actual trip row, not the access check

canAccessTrip only returns { id, user_id } (it's a membership check), but the
rpc-host's trips.getById returned it verbatim — so plugins saw a trip with no
title/start_date/etc. Fetch the real row after the access check. Also fix the
reference plugin to read t.title (the trips column is 'title', not 'name').
This commit is contained in:
mauriceboe
2026-07-03 19:01:23 +02:00
parent 2d492d4f4e
commit 1a7f7a9340
3 changed files with 12 additions and 5 deletions
@@ -31,7 +31,7 @@ module.exports = definePlugin({
return {
status: 200,
headers: json(),
body: JSON.stringify({ trip: t ? { name: t.name, days } : null }),
body: JSON.stringify({ trip: t ? { name: t.title, days } : null }),
}
},
},