* Fix MM-45272

* Properly handle permalinks

* Fix

* Fix tests

* Handle only not found case for team member

* Fix lint

* Use proper config value

* Separate permission in several statements

* Add tests

* Fix lint

* Revert changes on utils

* Address feedback and more fixes

* Address feedback

* Fix test

* Fix test and related bug

* Fix and reorder test

* Address feedback

* Address feedback

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Daniel Espino García
2023-11-30 11:43:51 +01:00
коммит произвёл GitHub
родитель c395ec6245
Коммит 2ff0fe343e
14 изменённых файлов: 381 добавлений и 178 удалений

Просмотреть файл

@@ -106,7 +106,7 @@ import type {
MarketplaceApp,
MarketplacePlugin,
} from '@mattermost/types/marketplace';
import {Post, PostList, PostSearchResults, OpenGraphMetadata, PostsUsageResponse, TeamsUsageResponse, PaginatedPostList, FilesUsageResponse, PostAcknowledgement, PostAnalytics} from '@mattermost/types/posts';
import {Post, PostList, PostSearchResults, PostsUsageResponse, TeamsUsageResponse, PaginatedPostList, FilesUsageResponse, PostAcknowledgement, PostAnalytics, PostInfo} from '@mattermost/types/posts';
import {Draft} from '@mattermost/types/drafts';
import {Reaction} from '@mattermost/types/reactions';
import {Role} from '@mattermost/types/roles';
@@ -2160,6 +2160,13 @@ export default class Client4 {
);
};
getPostInfo = (postId: string) => {
return this.doFetch<PostInfo>(
`${this.getPostRoute(postId)}/info`,
{method: 'get'},
)
}
getPostsByIds = (postIds: string[]) => {
return this.doFetch<Post[]>(
`${this.getPostsRoute()}/ids`,

Просмотреть файл

@@ -5,6 +5,7 @@ import {Channel, ChannelType} from './channels';
import {CustomEmoji} from './emojis';
import {FileInfo} from './files';
import {Reaction} from './reactions';
import { TeamType } from './teams';
import {UserProfile} from './users';
import {
RelationOneToOne,
@@ -208,4 +209,15 @@ export type ActivityEntry = {
actorId: string[];
userIds: string[];
usernames: string[];
}
export type PostInfo = {
channel_id: string;
channel_type: ChannelType;
channel_display_name: string;
has_joined_channel: boolean;
team_id: string;
team_type: TeamType;
team_display_name: string;
has_joined_team: boolean;
}