Changeset 9854393 for pages


Ignore:
Timestamp:
12/27/25 02:27:36 (7 months ago)
Author:
Tome <gjorgievtome@…>
Branches:
main
Children:
ad311c3
Parents:
82aa6ae
Message:

implement components query and filtering

Location:
pages
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pages/+Layout.telefunc.ts

    r82aa6ae r9854393  
    1010}
    1111
    12 export async function onGetAllComponents({ componentType, limit, q }
    13                                             : { componentType?: string; limit?: number; q?: string }) {
     12export async function onGetAllComponents({ componentType, limit, sort, q }
     13                                            : { componentType?: string; limit?: number; sort?: string, q?: string }) {
    1414    const c = ctx();
    1515
    16     const components = await drizzleQueries.getAllComponents(c.db, limit, componentType, q);
     16    const components = await drizzleQueries.getAllComponents(c.db, limit, componentType, sort, q);
    1717
    1818    return components;
  • pages/forge/forge.telefunc.ts

    r82aa6ae r9854393  
    6262}
    6363
    64 export async function onGetCompatibleComponents({ buildId, componentType }: { buildId: number, componentType: string }) {
     64export async function onGetCompatibleComponents({ buildId, componentType, limit, sort }
     65                                                : { db: Database, buildId: number, componentType: string, limit?: number, sort?: string }) {
    6566    const { c, userId } = requireUser()
    6667
    6768    if(!Number.isInteger(buildId) || buildId <= 0) throw Abort();
    6869
    69     const compatibleComponents = await drizzleQueries.getCompatibleComponents(c.db, buildId, componentType);
     70    const compatibleComponents = await drizzleQueries.getCompatibleComponents(c.db, buildId, componentType, limit, sort);
    7071
    7172    if(!compatibleComponents) throw Abort();
Note: See TracChangeset for help on using the changeset viewer.