Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

server(theme): sort themes by total installs

Abdullah Attabf4d168c9619
diff --git a/servers/themes/src/orama.ts b/servers/themes/src/orama.ts
index 744bec650..d07b35da3 100644
--- a/servers/themes/src/orama.ts
+++ b/servers/themes/src/orama.ts
@@ -30,7 +30,8 @@ export async function initializeDatabase(): Promise<Orama> {
colorScheme: "string",
compatibilityVersion: "number",
description: "string",
- tags: "string[]"
+ tags: "string[]",
+ totalInstalls: "number"
},
id: "notesnook-themes"
});
@@ -60,6 +61,10 @@ export async function getThemes(query: (typeof ThemeQuerySchema)["_type"]) {
const count = query.limit;
const searchParams: SearchParams = {
+ sortBy: {
+ property: "totalInstalls",
+ order: "DESC"
+ },
where: {
compatibilityVersion: {
eq: query.compatibilityVersion