db
This commit is contained in:
+2
-2
@@ -205,12 +205,12 @@ export const getLocationBySlug = cache(async function(slug: string) {
|
|||||||
|
|
||||||
export async function getProjectsByService(serviceName: string) {
|
export async function getProjectsByService(serviceName: string) {
|
||||||
try {
|
try {
|
||||||
// Search projects where the serviceName is in the title or categories
|
// Search projects where the serviceName is in the title or category
|
||||||
// serviceName is expected to be something like "Drone Çekimi"
|
// serviceName is expected to be something like "Drone Çekimi"
|
||||||
return await sql`
|
return await sql`
|
||||||
SELECT * FROM projects
|
SELECT * FROM projects
|
||||||
WHERE title ILIKE ${'%' + serviceName + '%'}
|
WHERE title ILIKE ${'%' + serviceName + '%'}
|
||||||
OR categories::text ILIKE ${'%' + serviceName + '%'}
|
OR category::text ILIKE ${'%' + serviceName + '%'}
|
||||||
ORDER BY created_at DESC
|
ORDER BY created_at DESC
|
||||||
LIMIT 4
|
LIMIT 4
|
||||||
`;
|
`;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user