Websites v4 docs v5.2.5
    Preparing search index...

    Hierarchy

    Index

    Properties

    Accessors

    Methods

    Properties

    pagination: Pagination | null
    serializer: (model: any) => any

    serializer is a pure function that takes a model instance and returns a plain object that describes how to convert the model to JSON

    Accessors

    Methods

    • Retrieves a value from raw API data. Prioritises DBAPI data if available

      Parameters

      • key: string

      Returns any

    • Special method to define behaviour of JSON.stringify() on model instance

      Returns any

    • This will add an updloaded image asset to the DB

      Parameters

      • __namedParameters: { imageData: CreateImage | null; siteId: number | null }

      Returns Promise<
          | {
              errors: { message: { status: number } }[]
              | null;
              result:
                  | { homeflow_id: string
                  | undefined; path: string; url: string }
                  | null;
          }
          | null,
      >

      const res = await ImageModel.create({ imageData: body, siteId: agency.siteId });
      

      Image creation requires a Bearer token (app verification) via production users api, regardless of environment. This is handled in the images-api-client/index.ts

    • This will return an array of image objects with the structure:

      Parameters

      • __namedParameters: { name?: string; page?: number; pageSize?: number; type?: string }

      Returns Promise<
          {
              errors: ModelError[]
              | null;
              pagination: Pagination | null;
              results: Image[];
          },
      >

      { url: string; alt: string; }