Updated on 2023-03-23 GMT+08:00

Scenario 5: Canceling a Meeting

Description

After a meeting is scheduled, you can call the API of canceling a meeting to cancel the meeting.

Service Process

To cancel a meeting, call the cancelConf API and implement the callback function onCancelConfResult and the subscribed-to notification onConfListChanged.

  1. Call an API.

    1. Assemble the data structure CancelConfParam and the API callback function onCancelConfResult.
    2. Call the cancelConf API to cancel the meeting. The data in the preceding step is used as input parameters.

  2. Implement the callback function.

    Implement the onCancelConfResult function.

  3. Implement the notification function.

    Implement the onConfListChanged function.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
/**
* API for canceling a meeting
*/
async cancelConfById() {
    let param = {
        confId: "989156631",
    }
    console.log(param);
    const apiService = new ApiService();
    let setResult = await apiService.cancelConf(param);;
    if (setResult.ret != 0) {
        window.electron.ipcRenderer.send("show-error-alert", "cancelConf error = " + setResult.ret);
    }
    this.props.history.push('/main');
}

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
/**
* Definition of cancelConf API in ApiService
*/
async cancelConf(cancelConfParam) {
  return new Promise((resolve) => {
    let resultCallback = (ret, reason) => {
      console.log("cancelConf, out data = ", { ret, reason });
      resolve({ ret, reason });
    };
    console.log("cancelConf, in param = ", cancelConfParam);
    this.uisdkService.getConfMgrApi().cancelConf(cancelConfParam, resultCallback);
  });
}

The onConfListChanged event notification scenario is the same as the meeting scheduling scenario. For details, see Sample Code.