Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Changes to make asset service query able based on feathers (#10177)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanzlamateen authored May 17, 2024
1 parent 55c934e commit 1c9dc7a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/common/src/schemas/assets/asset.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Ethereal Engine. All Rights Reserved.

// For more information about this file see https://dove.feathersjs.com/guides/cli/service.schemas.html
import type { Static } from '@feathersjs/typebox'
import { Type, getValidator } from '@feathersjs/typebox'
import { Type, getValidator, querySyntax } from '@feathersjs/typebox'
import { dataValidator, queryValidator } from '../validators'

export const assetPath = 'asset'
Expand Down Expand Up @@ -80,15 +80,16 @@ export const assetPatchSchema = Type.Object(
export interface AssetPatch extends Static<typeof assetPatchSchema> {}

// Schema for allowed query properties
export const assetQueryProperties = Type.Pick(assetDataSchema, ['assetURL', 'project', 'projectId'])

export const assetQuerySchema = Type.Intersect(
[
querySyntax(assetQueryProperties),
// Add additional query properties here
Type.Object(
{
project: Type.Optional(Type.String()),
projectId: Type.Optional(Type.String()),
assetURL: Type.Optional(Type.String()),
internal: Type.Optional(Type.Boolean()),
paginate: Type.Optional(Type.Boolean())
paginate: Type.Optional(Type.Boolean()),
internal: Type.Optional(Type.Boolean())
},
{ additionalProperties: false }
)
Expand Down

0 comments on commit 1c9dc7a

Please sign in to comment.