Effect CommunityEC
Effect Community8mo ago
4 replies
amg

Error with SupabaseError Type in HttpApiGroup Configuration

hi I am trying to create an HttpApiGroup and set possible errors

export class ProductApiGroup extends HttpApiGroup.make("product")
  .add(
    HttpApiEndpoint.get("products", "/products").addSuccess(
      // Schema.Array(Product), // TODO: cambiar
      Schema.String,
    ),
  )
  .add(
    HttpApiEndpoint.get("product", "/product/:id")
      // .addSuccess(Schema.String)
      .addSuccess(Product)
      .addError(ErrorInvalidProduct)
      .addError(SupabaseError)
      .setPath(
        Schema.Struct({
          id: Schema.NonEmptyString,
        }),
      ),
  ) {}

Typesccript is complaining about the SupabaseError
deno-ts: Argument of type 'typeof SupabaseError' is not assignable to parameter of type 'Any'.
  Type 'typeof SupabaseError' is missing the following properties from type 'Schema<any, any, unknown>': Type, Encoded, Context, ast, and 3 more. [2345]
Was this page helpful?