Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "post/post.service"

Index

Variables

Const FIRST_PICTURE_REGEXP

FIRST_PICTURE_REGEXP: RegExp = /(?:!\[.*?\]\((.*?)\)|src="([^"]+)")/

Functions

attachPostsToEntry

  • attachPostsToEntry(eventId: any, userId: any, entryId: any, options?: object): Promise<[Object, Object, Object, Object, Object, Object, Object, Object, Object, Object]>
  • Attach existing post on the event from a user the given entry

    Parameters

    • eventId: any
    • userId: any
    • entryId: any
    • Default value options: object = {}
      • Optional transacting?: any

    Returns Promise<[Object, Object, Object, Object, Object, Object, Object, Object, Object, Object]>

createPost

  • createPost(user: any, eventId?: any): Promise<any>
  • Creates and persists a new post, initializing the owner UserRole.

    Parameters

    • user: any
    • Default value eventId: any = null

      the optional ID of an event to associate with.

    Returns Promise<any>

deletePost

  • deletePost(post: any): Promise<void>

findLatestAnnouncement

  • findLatestAnnouncement(options?: any): Promise<any>
  • Finds the latest announcement

    Parameters

    • Default value options: any = {}

      among "eventId"

    Returns Promise<any>

findPost

  • findPost(options?: any): Promise<any>
  • Finds one post

    Parameters

    • Default value options: any = {}

      among "id name userId eventId specialPostType allowDrafts"

    Returns Promise<any>

findPostById

  • findPostById(postId: any): Promise<any>

findPosts

  • findPosts(options?: object): Promise<any>
  • Finds all posts from a feed (specified through options)

    Parameters

    • Default value options: object = {}

      among "specialPostType allowHidden allowDrafts eventId entryId userId"

      • Optional allowDrafts?: boolean
      • Optional allowHidden?: boolean
      • Optional entryId?: number | string
      • Optional eventId?: number | string
      • Optional page?: number
      • Optional specialPostType?: string
      • Optional transacting?: any
      • Optional userId?: number | string

    Returns Promise<any>

getFirstPicture

  • getFirstPicture(model: any): string
  • Finds the URL of the first picture in the body, if any. Quick and not-completely-reliable implementation.

    Parameters

    • model: any

      Any model with a body

    Returns string

isPast

  • isPast(time: any): boolean

refreshCommentCount

  • refreshCommentCount(node: any): Promise<void>
  • Updates the comment count on the given node and saves it.

    Parameters

    • node: any

    Returns Promise<void>

wasEdited

  • wasEdited(model: any): boolean
  • Tells whether a model has been edited > 1 hour after its creation

    Parameters

    • model: any

      Any model with timestamps

    Returns boolean

Generated using TypeDoc