Skip to content

Add support for set-status #156

@commonpike

Description

@commonpike
Post.setStatus(status: PostStatus) {
   switch(status) {
      case: UNSCHEDULED
        unset this.published
        unset this.scheduled
      case: SCHEDULED
        unset this.published
        this.scheduled = this.scheduled :? now()
      case: PUBLISHED
        this.scheduled = this.scheduled :? now()
        this.published = this.published :? now()

   }
   this.status = status
   await this.save() // calls source.updateStage
}
/*
  UNKNOWN = "unknown",
  UNSCHEDULED = "unscheduled",
  SCHEDULED = "scheduled",
  PUBLISHED = "published",
  CANCELED = "canceled",
  FAILED = "failed",
*/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions