Ghost content api ghostdata fix (#43417)

* ReadFunction requres either id or slug in data.

* Added name to the authors

* Changed data arg to an either or id/slug option

Co-authored-by: Yashar Moradi <yashar.moradi@scoperty.de>
This commit is contained in:
Yashar Moradi
2020-04-02 11:08:34 -07:00
committed by GitHub
co-authored by Yashar Moradi
parent f49c947989
commit 29901d8879
+2 -1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/TryGhost/Ghost-SDK/tree/master/packages/content-api
// Definitions by: Kevin Nguyen <https://github.com/knguyen0125>
// Anton Van Eechaute <https://github.com/antonve>
// Yashar Moradi <https://github.com/maveric1977>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export type ArrayOrValue<T> = T | T[];
@@ -166,7 +167,7 @@ export interface BrowseFunction<T> {
}
export interface ReadFunction<T> {
(data: GhostData, options?: Params, memberToken?: Nullable<string>): Promise<T>;
(data: { id: Nullable<string> } | { slug: Nullable<string> }, options?: Params, memberToken?: Nullable<string>): Promise<T>;
}
export interface PostObject {