Changeset 5ce5904 for pages/+Layout.telefunc.ts
- Timestamp:
- 12/20/25 04:04:03 (7 months ago)
- Branches:
- main
- Children:
- ee1fa4e
- Parents:
- c4dd17d
- File:
-
- 1 edited
-
pages/+Layout.telefunc.ts (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pages/+Layout.telefunc.ts
rc4dd17d r5ce5904 4 4 5 5 export async function getAuthenticationState() { 6 const c = getAuthState();6 const context = getAuthState(); 7 7 8 return c ;8 return context; 9 9 } 10 10 11 export async function getPopupAllComponents({ componentType, q, limit}12 : { componentType?: string; q?: string; limit?: number}) {11 export async function getPopupAllComponents({ componentType, limit, q } 12 : { componentType?: string; limit?: number; q?: string }) { 13 13 const c = ctx(); 14 14 15 // getAllComponents 15 const components = await drizzleQueries.getAllComponents(c.db, limit, q, componentType); 16 17 return components; 18 } 19 20 export async function getPopupComponentDetails({ componentId } 21 : { componentId: number }) { 22 const context = ctx(); 23 24 if(!Number.isInteger(componentId) || componentId <= 0) throw Abort(); 25 26 const componentDetails = await drizzleQueries.getComponentDetails(context.db, componentId); 27 28 if(!componentDetails) throw Abort(); 29 30 return componentDetails; 31 } 32 33 export async function getPopupSuggestComponent({ link, description, componentType } 34 : { link: string; description: string; componentType: string }) { 35 const { c, userId } = requireUser() 36 37 const newSuggestionId = await drizzleQueries.addComponentSuggestion(c.db, userId, link, description, componentType); 38 39 if(!newSuggestionId) throw Abort(); 40 41 return newSuggestionId; 16 42 } 17 43 … … 38 64 export async function getPopupBuildDetails({ buildId } 39 65 : { buildId: number }) { 40 const context = ctx();66 const context = getAuthState(); 41 67 42 68 if(!Number.isInteger(buildId) || buildId <= 0) throw Abort(); 43 69 44 const buildDetails = await drizzleQueries.getBuildDetails(context.db, buildId );70 const buildDetails = await drizzleQueries.getBuildDetails(context.db, buildId, context.userId ?? undefined); 45 71 46 72 if(!buildDetails) throw Abort(); … … 65 91 66 92 if (!Number.isInteger(buildId) || buildId <= 0) throw Abort(); 93 94 if (!Number.isInteger(value) || value < 1 || value > 5) throw Abort(); 67 95 68 96 const result = await drizzleQueries.setBuildRating(c.db, userId, buildId, value);
Note:
See TracChangeset
for help on using the changeset viewer.
