Interface UpdateProductForTenantOptions<TFormCustomFields, TProductCustomFields>

interface UpdateProductForTenantOptions<TFormCustomFields, TProductCustomFields> {
    services: {
        catalogApi: Pick<CatalogApi<TProductCustomFields, unknown, unknown>, "listAttributes" | "createAttachment" | "deleteAttachment" | "getAttachmentUploadUrl" | "getProduct" | "listCategories" | "updateProduct">;
        fileUploader: Pick<FileUploader, "uploadFile">;
    };
    settings: {
        apiToFormData?: ((product?, attributeItemGroups?) => Partial<CreateProductFormData<TFormCustomFields>>);
        attributeName?: string;
        formDataToApi?: ((formData, attachmentId?, attributeId?) => UpdateProductDto<TProductCustomFields>);
        nameForAttributeItem?: ((key, groupKey, t) => string);
        nameForAttributeItemGroup?: ((groupKey, t) => string);
        nameForCategory?: ((name, t) => string);
        successRoute: string;
    };
    views?: {
        Form: CreateUpdateProductForTenantFormView<TFormCustomFields>;
    };
}

Type Parameters

  • TFormCustomFields

  • TProductCustomFields

Properties

services: {
    catalogApi: Pick<CatalogApi<TProductCustomFields, unknown, unknown>, "listAttributes" | "createAttachment" | "deleteAttachment" | "getAttachmentUploadUrl" | "getProduct" | "listCategories" | "updateProduct">;
    fileUploader: Pick<FileUploader, "uploadFile">;
}

Type declaration

  • catalogApi: Pick<CatalogApi<TProductCustomFields, unknown, unknown>, "listAttributes" | "createAttachment" | "deleteAttachment" | "getAttachmentUploadUrl" | "getProduct" | "listCategories" | "updateProduct">

    Catalog API methods

  • fileUploader: Pick<FileUploader, "uploadFile">

    File upload API

settings: {
    apiToFormData?: ((product?, attributeItemGroups?) => Partial<CreateProductFormData<TFormCustomFields>>);
    attributeName?: string;
    formDataToApi?: ((formData, attachmentId?, attributeId?) => UpdateProductDto<TProductCustomFields>);
    nameForAttributeItem?: ((key, groupKey, t) => string);
    nameForAttributeItemGroup?: ((groupKey, t) => string);
    nameForCategory?: ((name, t) => string);
    successRoute: string;
}

Type declaration

  • Optional apiToFormData?: ((product?, attributeItemGroups?) => Partial<CreateProductFormData<TFormCustomFields>>)

    Callback to convert API data to default form values

  • Optional attributeName?: string

    Attribute to limit attribute item options to (e.g. skills). Attribute items will be passed down to the view via this name. If no name is provided, attribute items will be empty and no API call is triggered.

  • Optional formDataToApi?: ((formData, attachmentId?, attributeId?) => UpdateProductDto<TProductCustomFields>)

    Callback to convert form data to API

  • Optional nameForAttributeItem?: ((key, groupKey, t) => string)

    Name function for Attribute items. Use for translating attribute items. Default behavior will use the translation given by Geekle:skills.${key}

      • (key, groupKey, t): string
      • Name function for Attribute items. Use for translating attribute items. Default behavior will use the translation given by Geekle:skills.${key}

        Parameters

        • key: string
        • groupKey: string
        • t: TFunction<"translation", undefined>

        Returns string

  • Optional nameForAttributeItemGroup?: ((groupKey, t) => string)

    Name function for Attribute items. Use for translating attribute item groups. Default behavior will use the translation given by Geekle:skillGroups.${groupKey}

      • (groupKey, t): string
      • Name function for Attribute items. Use for translating attribute item groups. Default behavior will use the translation given by Geekle:skillGroups.${groupKey}

        Parameters

        • groupKey: string
        • t: TFunction<"translation", undefined>

        Returns string

  • Optional nameForCategory?: ((name, t) => string)

    Name function for Categories. Use for translating category names. Default behavior will use the translation given by Geekle:categories.${name}

      • (name, t): string
      • Name function for Categories. Use for translating category names. Default behavior will use the translation given by Geekle:categories.${name}

        Parameters

        • name: string
        • t: TFunction<"translation", undefined>

        Returns string

  • successRoute: string

    Route to redirect to on successful product update

Generated using TypeDoc