Failed to run sql query syntax error at or near end

Does anyone see what's wrong with my sql function?

create function create_listing_liked_notification (receiver_id uuid, liker_id uuid, listing_id uuid)
returns void
language plpgsql
as $$
declare
  new_notification_id bigint;
begin
  insert into notifications ("receiverId", "actorId")
  values (receiver_id, liker_id)
  returning id into new_notification_id;
  insert into listingNotifications("notificationType", "notificationId", "listingId")
  values (1, new_notification_id, listing_id)
end;
$$;
Was this page helpful?