瀏覽代碼

Update vcard.js

Example code wouldn't work anymore.
ayu 3 年之前
父節點
當前提交
ae6dbeb287
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/headless/plugins/vcard.js

+ 4 - 4
src/headless/plugins/vcard.js

@@ -280,14 +280,14 @@ converse.plugins.add('converse-vcard', {
                  * @param {string} jid The JID for which the VCard should be set
                  * @param {string} jid The JID for which the VCard should be set
                  * @param {object} data A map of VCard keys and values
                  * @param {object} data A map of VCard keys and values
                  * @example
                  * @example
-                 * _converse.api.vcard.set({
-                 *     'jid': _converse.bare_jid,
+                 * let jid = _converse.bare_jid;
+                 * _converse.api.vcard.set( jid, {
                  *     'fn': 'John Doe',
                  *     'fn': 'John Doe',
                  *     'nickname': 'jdoe'
                  *     'nickname': 'jdoe'
                  * }).then(() => {
                  * }).then(() => {
                  *     // Succes
                  *     // Succes
-                 * }).catch(() => {
-                 *     // Failure
+                 * }).catch((e) => {
+                 *     // Failure, e is your error object
                  * }).
                  * }).
                  */
                  */
                 async set (jid, data) {
                 async set (jid, data) {