RecordUpsert is a [models.Record] upsert (create/update) form.

Hierarchy

Implements

Constructors

Methods

  • AddFiles adds the provided file(s) to the specified file field.

    If the file field is a SINGLE-value file field (aka. "Max Select = 1"), then the newly added file will REPLACE the existing one. In this case if you pass more than 1 files only the first one will be assigned.

    If the file field is a MULTI-value file field (aka. "Max Select > 1"), then the newly added file(s) will be APPENDED to the existing one(s).

    Example

     f1, _ := filesystem.NewFileFromPath("/path/to/file1.txt")
    f2, _ := filesystem.NewFileFromPath("/path/to/file2.txt")
    form.AddFiles("documents", f1, f2)

    Parameters

    Returns void

  • DrySubmit performs a form submit within a transaction and reverts it. For actual record persistence, check the form.Submit() method.

    This method doesn't handle file uploads/deletes or trigger any app events!

    Parameters

    • callback: ((txDao) => void)
        • (txDao): void
        • Parameters

          Returns void

    Returns void

  • LoadRequest extracts the json or multipart/form-data request data and lods it into the form.

    File upload is supported only via multipart/form-data.

    Parameters

    Returns void

  • RemoveFiles removes a single or multiple file from the specified file field.

    NB! If filesToDelete is not set it will remove all existing files assigned to the file field (including those assigned with AddFiles)!

    Example

     // mark only only 2 files for removal
    form.RemoveFiles("documents", "file1_aw4bdrvws6.txt", "file2_xwbs36bafv.txt")

    // mark all "documents" files for removal
    form.RemoveFiles("documents")

    Parameters

    • key: string
    • Rest ...toDelete: string[]

    Returns void

  • SetFullManageAccess sets the manageAccess bool flag of the current form to enable/disable directly changing some system record fields (often used with auth collection records).

    Parameters

    • fullManageAccess: boolean

    Returns void

  • Submit validates the form and upserts the form Record model.

    You can optionally provide a list of InterceptorFunc to further modify the form behavior before persisting it.

    Parameters

    Returns void

  • Validate makes the form validatable by implementing [validation.Validatable] interface.

    Returns void

Properties

email: string
emailVisibility: boolean
id: string

base model fields

oldPassword: string
password: string
passwordConfirm: string
username: string
verified: boolean

Generated using TypeDoc