mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 13:22:39 +03:00
99f29a169c
closes https://github.com/TryGhost/Arch/issues/91
- We have on cascade delete (a9f9f6121a/ghost/core/core/server/data/schema/schema.js (L1068)
) on `post_id` column which handles post deletion logic automatically on DB level.
- The commented out handlers in the long term should be hooked up with public CollectionService methods on the client side.
18 lines
496 B
TypeScript
18 lines
496 B
TypeScript
export class PostDeletedEvent {
|
|
id: string;
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
data: any;
|
|
timestamp: Date;
|
|
|
|
constructor(data: PostDeletedEvent, timestamp: Date) {
|
|
this.id = data.id;
|
|
this.data = data.data;
|
|
this.timestamp = timestamp;
|
|
}
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
static create(data: any, timestamp = new Date()) {
|
|
return new PostDeletedEvent(data, timestamp);
|
|
}
|
|
}
|