Skip to content

Commit

Permalink
Change RestChannel._publish to only pass error to callback
Browse files Browse the repository at this point in the history
That’s all that the `publish` method looks at anyway, and will aid us in
converting `_publish` to use promises.
  • Loading branch information
lawrence-forooghian committed Dec 12, 2023
1 parent fa06a55 commit 4ee8efe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/common/lib/client/restchannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import Message, {
} from '../types/message';
import ErrorInfo from '../types/errorinfo';
import { PaginatedResult } from './paginatedresource';
import Resource, { ResourceCallback } from './resource';
import Resource from './resource';
import { ChannelOptions } from '../../types/channel';
import { ErrCallback } from '../../types/utils';
import BaseRest from './baseclient';
import * as API from '../../../../ably';
import Defaults, { normaliseChannelOptions } from '../util/defaults';
Expand Down Expand Up @@ -125,15 +126,15 @@ class RestChannel {
});
}

_publish(requestBody: unknown, headers: Record<string, string>, params: any, callback: ResourceCallback): void {
_publish(requestBody: unknown, headers: Record<string, string>, params: any, callback: ErrCallback): void {
Resource.post(
this.client,
this.client.rest.channelMixin.basePath(this) + '/messages',
requestBody,
headers,
params,
null,
callback
(err) => callback(err)
);
}

Expand Down

0 comments on commit 4ee8efe

Please sign in to comment.