cmd/wallet-js-sdk/src/credential/credential-manager.js
/**
   * Updates credential metadata. Currently supporting updating only credential name and description fields.
   *
   *  @param {String} auth - authorization token for wallet operations.
   *  @param {String} id - ID of the credential metadata to be updated.
   *  @param {Object} options - options to update credential metadata.
   *  @param {String} options.name - (optional) name attribute of the credential metadata to be updated.
   *  @param {String} options.description - (optional) description attribute of the credential metadata to be updated.
   *  @param {String} options.collection - (optional) ID  of the collection to which this credential metadata to be updated.
   *
   *  @returns {Promise<Object>} - empty promise or error if operation fails.
   */
Updates credential metadata. Currently supporting updating only credential name and description fields.
@param {String} auth - authorization token for wallet operations.
@param {String} id - ID of the credential metadata to be updated.
@param {Object} options - options to update credential metadata.
@param {String} options.name - (optional) name attribute of the credential metadata to be updated.
@param {String} options.description - (optional) description attribute of the credential metadata to be updated.
@param {String} options.collection - (optional) ID  of the collection to which this credential metadata to be updated.

@returns {Promise} - empty promise or error if operation fails.
Updates credential metadata . Currently supporting updating only credential name and description fields . @param { String } auth - authorization token for wallet operations . @param { String } id - ID of the credential metadata to be updated . @param { Object } options - options to update credential metadata . @param { String } options . name - ( optional ) name attribute of the credential metadata to be updated . @param { String } options . description - ( optional ) description attribute of the credential metadata to be updated . @param { String } options . collection - ( optional ) ID of the collection to which this credential metadata to be updated . @returns { Promise } - empty promise or error if operation fails .
async updateCredentialMetadata(auth, id, { name, description, collection }) {
    let { content } = await this.wallet.get({
      auth,
      contentType: contentTypes.METADATA,
      contentID: id,
    });
    if (name) {
      content.name = name;
    }
    if (description) {
      content.description = description;
    }
    await this.wallet.remove({
      auth,
      contentType: contentTypes.METADATA,
      contentID: id,
    });
    await this.wallet.add({
      auth,
      contentType: contentTypes.METADATA,
      collectionID: collection,
      content,
    });
  }
async updateCredentialMetadata ( auth , id , { name , description , collection } ) { let { content } = await this . wallet . get ( { auth , contentType : contentTypes . METADATA , contentID : id , } ) ; if ( name ) { content . name = name ; } if ( description ) { content . description = description ; } await this . wallet . remove ( { auth , contentType : contentTypes . METADATA , contentID : id , } ) ; await this . wallet . add ( { auth , contentType : contentTypes . METADATA , collectionID : collection , content , } ) ; }
Updates credential metadata.
Updates credential metadata .
// remove // add again