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

ChatMessage Add Fix #2812

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions packages/graph/teams/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,33 +174,27 @@ export interface IChannels extends _Channels, IGetById<IChannel> { }
export const Channels = graphInvokableFactory<IChannels>(_Channels);

/**
* Channel
* Message
*/
export class _Message extends _GraphQueryableInstance<IChatMessage> { }
export interface IMessage extends _Message { }
export const Message = graphInvokableFactory<IMessage>(_Message);

/**
* Channels
* Messages
*/
@defaultPath("messages")
@getById(Message)
export class _Messages extends _GraphQueryableCollection<IChatMessage[]> {

/**
* Creates a new Channel in the Team
* @param displayName The display name of the new channel
* @param description Optional description of the channel
* Adds a message
* @param message ChatMessage object that defines the message
*
*/
public async add(displayName: string, description = ""): Promise<IMessageCreateResult> {
public async add(message: IChatMessage): Promise<IMessageCreateResult> {

const postBody = {
description,
displayName,
};

const data = await graphPost(this, body(postBody));
const data = await graphPost(this, body(message));

return {
message: (<any>this).getById(data.id),
Expand Down
Loading