[GH-26715] Added Pagination Support for IncomingWebHooks (#27502)
* Added Pagination Support for IncomingWebHooks * Incorporated feedback from reviews * Removed trailing spaces * Restored deleted server en.json entries, fixed order in webapp en.json --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
@@ -87,6 +87,7 @@ import type {
|
||||
CommandResponse,
|
||||
DialogSubmission,
|
||||
IncomingWebhook,
|
||||
IncomingWebhooksWithCount,
|
||||
OAuthApp,
|
||||
OutgoingOAuthConnection,
|
||||
OutgoingWebhook,
|
||||
@@ -2625,17 +2626,18 @@ export default class Client4 {
|
||||
);
|
||||
};
|
||||
|
||||
getIncomingWebhooks = (teamId = '', page = 0, perPage = PER_PAGE_DEFAULT) => {
|
||||
getIncomingWebhooks = (teamId = '', page = 0, perPage = PER_PAGE_DEFAULT, includeTotalCount = false) => {
|
||||
const queryParams: any = {
|
||||
page,
|
||||
per_page: perPage,
|
||||
include_total_count: includeTotalCount,
|
||||
};
|
||||
|
||||
if (teamId) {
|
||||
queryParams.team_id = teamId;
|
||||
}
|
||||
|
||||
return this.doFetch<IncomingWebhook[]>(
|
||||
return this.doFetch<IncomingWebhook[] | IncomingWebhooksWithCount>(
|
||||
`${this.getIncomingHooksRoute()}${buildQueryString(queryParams)}`,
|
||||
{method: 'get'},
|
||||
);
|
||||
|
||||
@@ -19,6 +19,11 @@ export type IncomingWebhook = {
|
||||
channel_locked: boolean;
|
||||
};
|
||||
|
||||
export type IncomingWebhooksWithCount = {
|
||||
incoming_webhooks: IncomingWebhook[];
|
||||
total_count: number;
|
||||
};
|
||||
|
||||
export type OutgoingWebhook = {
|
||||
id: string;
|
||||
token: string;
|
||||
@@ -121,6 +126,7 @@ export type OutgoingOAuthConnection = {
|
||||
|
||||
export type IntegrationsState = {
|
||||
incomingHooks: IDMappedObjects<IncomingWebhook>;
|
||||
incomingHooksTotalCount: number;
|
||||
outgoingHooks: IDMappedObjects<OutgoingWebhook>;
|
||||
oauthApps: IDMappedObjects<OAuthApp>;
|
||||
outgoingOAuthConnections: IDMappedObjects<OutgoingOAuthConnection>;
|
||||
|
||||
Ссылка в новой задаче
Block a user