From d852a3d153f94609bf127688644d73f168cb4e64 Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Tue, 11 Oct 2022 19:28:36 -0700 Subject: [PATCH] Fix string concatenation --- src/api/services/communities.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/services/communities.zig b/src/api/services/communities.zig index abc02ef..7c2a2fa 100644 --- a/src/api/services/communities.zig +++ b/src/api/services/communities.zig @@ -261,7 +261,7 @@ pub fn query(db: anytype, args: QueryArgs, alloc: std.mem.Allocator) !QueryResul const max_items = if (args.max_items > max_max_items) max_max_items else args.max_items; if (args.owner_id != null) try builder.andWhere("owner_id = $1"); - if (args.like != null) try builder.andWhere("(host LIKE ('%' + $2 + '%') OR name LIKE ('%' + $2 + '%'))"); + if (args.like != null) try builder.andWhere("(host LIKE ('%' || $2 || '%') OR name LIKE ('%' || $2 || '%'))"); if (args.created_before != null) try builder.andWhere("created_at < $3"); if (args.created_after != null) try builder.andWhere("created_at > $4"); if (args.prev) |prev| { @@ -345,7 +345,7 @@ pub fn query(db: anytype, args: QueryArgs, alloc: std.mem.Allocator) !QueryResul .order_val = getOrderVal(result_buf[count - 1], args.order_by), }; } - // TODO: This will give an incorrect previous page link on an empty page + // TODO: This will give incorrect links on an empty page return QueryResult{ .items = result_buf[0..count],