Skip to content

Commit 202bf73

Browse files
[NEW] update call status (#22854)
* add code for update call status * remove fourth param Co-authored-by: Murtaza Patrawala <34130764+murtaza98@users.noreply.github.com> Co-authored-by: Murtaza Patrawala <34130764+murtaza98@users.noreply.github.com>
1 parent 479361b commit 202bf73

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

app/livechat/server/api/v1/visitor.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,29 @@ API.v1.addRoute('livechat/visitor/:token/room', { authRequired: true }, {
128128
},
129129
});
130130

131+
API.v1.addRoute('livechat/visitor.callStatus', {
132+
post() {
133+
try {
134+
check(this.bodyParams, {
135+
token: String,
136+
callStatus: String,
137+
rid: String,
138+
});
139+
140+
const { token, callStatus, rid } = this.bodyParams;
141+
const guest = findGuest(token);
142+
if (!guest) {
143+
throw new Meteor.Error('invalid-token');
144+
}
145+
const status = callStatus;
146+
Livechat.updateCallStatus('', rid, status);
147+
return API.v1.success({ token, callStatus });
148+
} catch (e) {
149+
return API.v1.failure(e);
150+
}
151+
},
152+
});
153+
131154
API.v1.addRoute('livechat/visitor.status', {
132155
post() {
133156
try {

0 commit comments

Comments
 (0)