WebApp: Fix channel-detail page for non-owned channels
This commit is contained in:
@@ -21,6 +21,9 @@ export interface ChannelPreview {
|
||||
owner_user_id: string;
|
||||
internal_name: string;
|
||||
display_name: string;
|
||||
description_name: string | null;
|
||||
messages_sent: number;
|
||||
subscription: Subscription | null;
|
||||
}
|
||||
|
||||
export type ChannelSelector = 'owned' | 'subscribed' | 'all' | 'subscribed_any' | 'all_any';
|
||||
|
||||
@@ -19,8 +19,10 @@ export interface ClientListResponse {
|
||||
|
||||
export interface ClientPreview {
|
||||
client_id: string;
|
||||
user_id: string;
|
||||
name: string | null;
|
||||
type: ClientType;
|
||||
timestamp_created: string;
|
||||
agent_model: string;
|
||||
agent_version: string;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,10 @@ export interface KeyToken {
|
||||
export interface KeyTokenPreview {
|
||||
keytoken_id: string;
|
||||
name: string;
|
||||
owner_user_id: string;
|
||||
all_channels: boolean;
|
||||
channels: string[];
|
||||
permissions: string;
|
||||
}
|
||||
|
||||
export type TokenPermission = 'A' | 'CR' | 'CS' | 'UR';
|
||||
|
||||
@@ -6,6 +6,8 @@ import {
|
||||
User,
|
||||
UserWithExtra,
|
||||
UserPreview,
|
||||
ChannelPreview,
|
||||
KeyTokenPreview,
|
||||
Message,
|
||||
MessageListParams,
|
||||
MessageListResponse,
|
||||
@@ -98,6 +100,14 @@ export class ApiService {
|
||||
return this.http.get<ClientPreviewResponse>(`${this.baseUrl}/preview/clients/${clientId}`);
|
||||
}
|
||||
|
||||
getChannelPreview(channelId: string): Observable<ChannelPreview> {
|
||||
return this.http.get<ChannelPreview>(`${this.baseUrl}/preview/channels/${channelId}`);
|
||||
}
|
||||
|
||||
getKeyPreview(keyId: string): Observable<KeyTokenPreview> {
|
||||
return this.http.get<KeyTokenPreview>(`${this.baseUrl}/preview/keys/${keyId}`);
|
||||
}
|
||||
|
||||
// Channel endpoints
|
||||
getChannels(userId: string, selector?: ChannelSelector): Observable<ChannelListResponse> {
|
||||
let params = new HttpParams();
|
||||
|
||||
Reference in New Issue
Block a user