mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 00:11:49 +03:00
3599cfdd7a
refs https://github.com/TryGhost/Team/issues/3170 - When the collection filter is updated the collection's posts should be updated automatically.
21 lines
528 B
TypeScript
21 lines
528 B
TypeScript
import {InMemoryRepository} from '@tryghost/in-memory-repository';
|
|
|
|
type CollectionPost = {
|
|
id: string;
|
|
slug: string;
|
|
featured: boolean;
|
|
published_at: Date;
|
|
deleted: boolean;
|
|
};
|
|
|
|
export class PostsRepositoryInMemory extends InMemoryRepository<string, CollectionPost> {
|
|
protected toPrimitive(entity: CollectionPost): object {
|
|
return {
|
|
id: entity.id,
|
|
slug: entity.slug,
|
|
featured: entity.featured,
|
|
published_at: entity.published_at
|
|
};
|
|
}
|
|
}
|