code: function updateListItem(itemMetadata, customFileMetadata) {
              // Define the list item changes. Use the FileLeafRef property to change the display name. 
              // Assemble the file update metadata 
              var metadata = {
                  __metadata: {
                      type: itemMetadata.type
                  },
                  FileLeafRef: fileuniquename,
                  Title: filedisplayname
              };
  
              // Add the custom metadata fields for this file to the metadata object
              if (typeof(customFileMetadata) === "object") $(metadata).extend(metadata, customFileMetadata);
              
              // Send the request and return the promise.
              // This call does not return response content from the server.
              var body = JSON.stringify(metadata);
              return $http.post(itemMetadata.uri, body, {
                  headers: {
                      "X-RequestDigest": $("#__REQUESTDIGEST").val(),
                      "content-type": "application/json;odata=verbose",
                      "content-length": body.length,
                      "IF-MATCH": "*",
                      "X-HTTP-Method": "MERGE"
                  }
              });
          }
docs: Change the display name and title of the list item.