Changeset 226fbbb for pages/+Layout.telefunc.ts
- Timestamp:
- 12/23/25 04:21:42 (7 months ago)
- Branches:
- main
- Children:
- ea09e98
- Parents:
- ee1fa4e
- File:
-
- 1 edited
-
pages/+Layout.telefunc.ts (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pages/+Layout.telefunc.ts
ree1fa4e r226fbbb 2 2 import {ctx, getAuthState, requireUser} from "../server/telefunc/ctx"; 3 3 import {Abort} from "telefunc"; 4 import type {Database} from "../database/drizzle/db"; 4 5 5 export async function getAuthenticationState() {6 export async function AuthenticationState() { 6 7 const context = getAuthState(); 7 8 … … 9 10 } 10 11 11 export async function getPopupAllComponents({ componentType, limit, q }12 export async function onGetAllComponents({ componentType, limit, q } 12 13 : { componentType?: string; limit?: number; q?: string }) { 13 14 const c = ctx(); … … 18 19 } 19 20 20 export async function getPopupComponentDetails({ componentId }21 export async function onGetComponentDetails({ componentId } 21 22 : { componentId: number }) { 22 23 const context = ctx(); … … 31 32 } 32 33 33 export async function getPopupSuggestComponent({ link, description, componentType }34 export async function onSuggestComponent({ link, description, componentType } 34 35 : { link: string; description: string; componentType: string }) { 35 36 const { c, userId } = requireUser() 36 37 37 const newSuggestionId = await drizzleQueries.add ComponentSuggestion(c.db, userId, link, description, componentType);38 const newSuggestionId = await drizzleQueries.addNewComponentSuggestion(c.db, userId, link, description, componentType); 38 39 39 40 if(!newSuggestionId) throw Abort(); … … 42 43 } 43 44 44 export async function getPopupAllApprovedBuilds({ limit, q }45 export async function onGetApprovedBuilds({ limit, q } 45 46 : { limit?: number; q?: string }) { 46 47 const context = ctx(); … … 51 52 } 52 53 53 export async function getPopupHighestRankedBuilds({ limit }54 export async function onGetHighestRankedBuilds({ limit } 54 55 : { limit?: number }) { 55 56 const context = ctx(); … … 62 63 // Shared 63 64 64 export async function getPopupBuildDetails({ buildId }65 export async function onGetBuildDetails({ buildId } 65 66 : { buildId: number }) { 66 67 const context = getAuthState(); … … 75 76 } 76 77 77 export async function togglePopupFavorite({ buildId }78 export async function onToggleFavorite({ buildId } 78 79 : { buildId: number }) { 79 80 const { c, userId } = requireUser() … … 86 87 } 87 88 88 export async function setPopupRating({ buildId, value }89 export async function onSetRating({ buildId, value } 89 90 : { buildId: number; value: number }) { 90 91 const { c, userId } = requireUser() … … 99 100 } 100 101 101 export async function setPopupReview({ buildId, content }102 export async function onSetReview({ buildId, content } 102 103 : { buildId: number; content: string }) { 103 104 const { c, userId } = requireUser() … … 110 111 } 111 112 112 export async function clonePopupBuild({ buildId }113 export async function onCloneBuild({ buildId } 113 114 : { buildId: number }) { 114 115 const { c, userId } = requireUser() … … 116 117 if (!Number.isInteger(buildId) || buildId <= 0) throw Abort(); 117 118 118 const newBuild Id= await drizzleQueries.cloneBuild(c.db, userId, buildId);119 const newBuild = await drizzleQueries.cloneBuild(c.db, userId, buildId); 119 120 120 if (!newBuild Id) throw Abort();121 if (!newBuild) throw Abort(); 121 122 122 return newBuild Id;123 return newBuild; 123 124 } 125 126 127 128 129 130
Note:
See TracChangeset
for help on using the changeset viewer.
