forked from TryGhost/Ghost
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs TryGhost/Arch#95 These events can be used to know when an automatic collections posts have been updated, as well as by the repository to optimise the storage of CollectionPosts
- Loading branch information
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,19 @@ | ||
type CollectionPostAddedData = { | ||
collection_id: string; | ||
post_id: string; | ||
}; | ||
|
||
export class CollectionPostAdded { | ||
data: CollectionPostAddedData; | ||
timestamp: Date; | ||
type = 'CollectionPostAdded' as const; | ||
|
||
constructor(data: CollectionPostAddedData, timestamp: Date) { | ||
this.data = data; | ||
this.timestamp = timestamp; | ||
} | ||
|
||
static create(data: CollectionPostAddedData, timestamp = new Date()) { | ||
return new CollectionPostAdded(data, timestamp); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,19 @@ | ||
type CollectionPostRemovedData = { | ||
collection_id: string; | ||
post_id: string; | ||
}; | ||
|
||
export class CollectionPostRemoved { | ||
data: CollectionPostRemovedData; | ||
timestamp: Date; | ||
type = 'CollectionPostRemoved' as const; | ||
|
||
constructor(data: CollectionPostRemovedData, timestamp: Date) { | ||
this.data = data; | ||
this.timestamp = timestamp; | ||
} | ||
|
||
static create(data: CollectionPostRemovedData, timestamp = new Date()) { | ||
return new CollectionPostRemoved(data, timestamp); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters