Skip to content

Commit 0b72e8b

Browse files
authored
Merge pull request #240 from kuzzleio/user-notification-format
Fixed User Notification response format
2 parents 0525c18 + 60ae5f4 commit 0b72e8b

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/Room.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,6 @@ function notificationCallback (data) {
320320
data.document = new Document(this.collection, data.result._id, data.result._source, data.result._meta);
321321
delete data.result;
322322
}
323-
else if (data.type === 'user') {
324-
data.user = {count: data.result.count};
325-
delete data.result;
326-
}
327323

328324
if (this.kuzzle.requestHistory[data.requestId]) {
329325
if (this.subscribeToSelf) {

test/Room/methods.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,16 +403,16 @@ describe('Room methods', function () {
403403
notifCB.call(room, {
404404
controller: 'realtime',
405405
result: { count: 3 },
406-
type: 'user'
406+
type: 'user',
407+
user: 'in'
407408
});
408409

409410
should(room.callback)
410411
.be.calledOnce()
411412
.be.calledWithMatch(null, {
413+
result: { count: 3 },
412414
type: 'user',
413-
user: {
414-
count: 3
415-
}
415+
user: 'in',
416416
});
417417
});
418418

0 commit comments

Comments
 (0)