feat(ghost): Implement Tag, Author and Page models; add advanced filtering, search, bulk operations, image upload, related-posts, update tests and bump dependencies
This commit is contained in:
@@ -39,7 +39,7 @@ export interface ITag {
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface IPostOptions {
|
||||
export interface IPost {
|
||||
id: string;
|
||||
uuid: string;
|
||||
title: string;
|
||||
@@ -83,9 +83,9 @@ export interface IPostOptions {
|
||||
|
||||
export class Post {
|
||||
public ghostInstanceRef: Ghost;
|
||||
public postData: IPostOptions;
|
||||
public postData: IPost;
|
||||
|
||||
constructor(ghostInstanceRefArg: Ghost, postData: IPostOptions) {
|
||||
constructor(ghostInstanceRefArg: Ghost, postData: IPost) {
|
||||
this.ghostInstanceRef = ghostInstanceRefArg;
|
||||
this.postData = postData;
|
||||
}
|
||||
@@ -114,11 +114,11 @@ export class Post {
|
||||
return this.postData.primary_author;
|
||||
}
|
||||
|
||||
public toJson(): IPostOptions {
|
||||
public toJson(): IPost {
|
||||
return this.postData;
|
||||
}
|
||||
|
||||
public async update(postData: IPostOptions): Promise<Post> {
|
||||
public async update(postData: IPost): Promise<Post> {
|
||||
try {
|
||||
const updatedPostData = await this.ghostInstanceRef.adminApi.posts.edit(postData);
|
||||
this.postData = updatedPostData;
|
||||
|
Reference in New Issue
Block a user