forked from DebaucheryLibrarian/traxxx
Fixed undefined user ID in postgres function. Fixed and improved mobile alignment for new and stash icons on scene tile.
This commit is contained in:
parent
3b3f4a1f2d
commit
e301e2184c
|
@ -204,7 +204,7 @@ export default {
|
|||
width: 1rem;
|
||||
height: 1rem;
|
||||
box-sizing: border-box;
|
||||
padding: .375rem .25rem;
|
||||
margin: .25rem;
|
||||
border-radius: 0 0 .5rem 0;
|
||||
color: var(--primary);
|
||||
font-size: 1rem;
|
||||
|
@ -434,7 +434,13 @@ export default {
|
|||
.tile.new .poster::after {
|
||||
bottom: 0;
|
||||
top: auto;
|
||||
border-radius: 0 .5rem 0 0;
|
||||
margin: 0 .25rem;
|
||||
}
|
||||
|
||||
.stash {
|
||||
left: 0;
|
||||
right: auto;
|
||||
padding: .25rem .5rem .5rem .25rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1157,7 +1157,8 @@ exports.up = knex => Promise.resolve()
|
|||
// allow vim fold
|
||||
return knex.raw(`
|
||||
CREATE FUNCTION current_user_id() RETURNS INTEGER AS $$
|
||||
SELECT current_setting('user.id', true)::integer;
|
||||
/* if the user ID is undefined, the adapter will pass it as a string, which cannot be cast as NULL by ::integer */
|
||||
SELECT NULLIF(current_setting('user.id', true), '')::integer;
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
/* We need both the release entries and their search ranking, and PostGraphile does not seem to allow virtual foreign keys on function results.
|
||||
|
|
|
@ -14,7 +14,7 @@ const connectionString = `postgres://${config.database.query.user}:${config.data
|
|||
|
||||
async function pgSettings(req) {
|
||||
return {
|
||||
'user.id': req.session.user?.id,
|
||||
'user.id': req.session.user?.id || null, // undefined is passed as an empty string, avoid
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue