TwarrtEdit

final class TwarrtEdit : Model

When a Twarrt is edited, a TwarrtEdit is created and associated with the twarrt.

This is done for accountability purposes and the data collected is intended to be viewable only by users with an access level of .moderator or above.

Properties

  • id

    The edit’s ID.

    Declaration

    Swift

    @ID
    var id: UUID?
  • The previous contents of the post. The previous text of the post.

    Declaration

    Swift

    @Field
    var text: String
  • The previous images, if any.

    Declaration

    Swift

    @OptionalField
    var images: [String]?
  • Timestamp of the model’s creation, set automatically.

    Declaration

    Swift

    @Timestamp
    var createdAt: Date?

Relations

Initialization

  • Declaration

    Swift

    init()
  • Initializes a new TwarrtEdit with the current contents of a twarrt.. Call on the twarrt BEFORE editing it to save previous contents.

    Declaration

    Swift

    init(twarrt: Twarrt, editorID: UUID) throws

    Parameters

    twarrt

    The Twarrt that will be edited.