TwarrtEdit

final class TwarrtEdit : Model, @unchecked Sendable

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

    @TwarrtEdit
    .ID var id: UUID? { get set }
  • The previous contents of the post. The previous text of the post.

    Declaration

    Swift

    @TwarrtEdit
    .Field var text: String { get set }
  • The previous images, if any.

    Declaration

    Swift

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

    Declaration

    Swift

    @TwarrtEdit
    .Timestamp var createdAt: Date? { get set }

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.