Skip to content

Commit

Permalink
chore: add ability to order extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
nakedfool committed Dec 5, 2024
1 parent f87771d commit 9c8ac9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/react-app-revamp/lib/extensions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ export const fetchExtensions = async (): Promise<ExtensionSupabase[]> => {
const config = await import("@config/supabase");
const supabase = config.supabase;

const { data, error } = await supabase.from("extensions").select("name").eq("enabled", true);
const { data, error } = await supabase
.from("extensions")
.select("name, order")
.eq("enabled", true)
.order("order", { ascending: true });

if (error) {
throw new Error(`Error in fetchExtensions: ${error.message}`);
Expand Down
1 change: 1 addition & 0 deletions packages/react-app-revamp/supabase_schemas/extensions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ create table
id uuid not null default gen_random_uuid (),
name text not null,
enabled boolean not null,
order int null default null,
constraint extensions_pkey primary key (id)
) tablespace pg_default;

0 comments on commit 9c8ac9d

Please sign in to comment.