Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add item action to superdesk api #4366

Conversation

thecalcc
Copy link
Contributor

@thecalcc thecalcc commented Nov 6, 2023

Necessary because a planning extension has to use it.

@thecalcc thecalcc requested a review from tomaskikutis November 6, 2023 12:48
@@ -378,6 +378,12 @@ function get(id: IArticle['_id']): Promise<IArticle> {
return dataApi.findOne<IArticle>('archive', id);
}

function itemAction(article: IArticle): any {
Copy link
Member

@tomaskikutis tomaskikutis Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look up and specify the return type

@@ -430,7 +437,7 @@ interface IArticleApi {
*/
isPublished(article: IArticle, includeScheduled?: boolean): boolean;

itemAction(article: IArticle): {[key: string]: boolean};
itemAction(article: IArticle): {[key in IAuthoringActionType]: boolean};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid repeating the type you could use ReturnType<typeof itemAction>. If it was repeated more heavily I'd suggest to create another type like type IItemActionsResult = {[key in IAuthoringActionType]: boolean}

@thecalcc thecalcc merged commit 430c4d5 into superdesk:authoring-react-post-broadcasting Nov 7, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants