mirror of
https://github.com/BradNut/weddingsite
synced 2025-09-08 17:40:36 +00:00
Add transformation to build 64 and lower case search the DB.
This commit is contained in:
parent
197db9135b
commit
c79ad4995f
2 changed files with 15 additions and 8 deletions
|
|
@ -26,13 +26,18 @@ export default withSession(async (req, res) => {
|
|||
|
||||
try {
|
||||
const result = await knex('guests')
|
||||
.where(function () {
|
||||
this.where(
|
||||
'first_name',
|
||||
'like',
|
||||
`%${escape(firstName.trim())}%`
|
||||
).where('last_name', 'like', `%${escape(lastName.trim())}%`);
|
||||
})
|
||||
.where(
|
||||
knex.raw(
|
||||
'LOWER("first_name") = ?',
|
||||
`${escape(firstName.trim()).toLowerCase()}`
|
||||
)
|
||||
)
|
||||
.andWhere(
|
||||
knex.raw(
|
||||
'LOWER("last_name") = ?',
|
||||
`${escape(lastName.trim()).toLowerCase()}`
|
||||
)
|
||||
)
|
||||
.select(
|
||||
'first_name',
|
||||
'last_name',
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ import { buildUrl } from 'cloudinary-build-url';
|
|||
export default async function buildBase64Data(
|
||||
imageName,
|
||||
alt,
|
||||
additionalProps = {}
|
||||
additionalProps = {},
|
||||
transformations = {}
|
||||
) {
|
||||
const folderName = process.env.PUBLIC_FOLDER_NAME;
|
||||
const cloudName = process.env.PUBLIC_CLOUD_NAME;
|
||||
|
|
@ -15,6 +16,7 @@ export default async function buildBase64Data(
|
|||
cloud: {
|
||||
cloudName,
|
||||
},
|
||||
transformations,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue