From 69f9b6b2c654f9868a1b427c96554ef92a66c8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Diamond?= <32074058+Andre-Diamond@users.noreply.github.com> Date: Mon, 11 Nov 2024 12:45:45 +0200 Subject: [PATCH] refactor: Filter approved names and sort them in ascending order in getNames function --- utils/getNames.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/getNames.js b/utils/getNames.js index 23dec35..6999bf3 100644 --- a/utils/getNames.js +++ b/utils/getNames.js @@ -7,7 +7,9 @@ export async function getNames() { try { const { data, error, status } = await supabase .from('names') - .select('name'); + .select('name') + .eq('approved', true) + .order('name', { ascending: true }); if (error && status !== 406) throw error if (data) {