mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
Sonarcloud issues fixes (#3499)
* Sonarcloud issues fixes * Code smell fixes * Refactoring to remove new code duplications * Sonarcloud code smell fixes part I * Sonarcloud code smell fixes part II * Missing code smell fix * Add new ESLint rules to cover fixed SonarCloud issues * Add missing command * Add missing is existing check
This commit is contained in:
@@ -50,7 +50,7 @@ export class FileActionsApi {
|
||||
});
|
||||
}
|
||||
|
||||
async uploadFileWithRename(fileLocation: string, parentId: string = '-my-', newName: string, title: string = '', description: string = '') {
|
||||
async uploadFileWithRename(fileLocation: string, newName: string, parentId: string = '-my-', title: string = '', description: string = '') {
|
||||
const file = fs.createReadStream(fileLocation);
|
||||
const nodeProps = {
|
||||
properties: {
|
||||
@@ -93,7 +93,7 @@ export class FileActionsApi {
|
||||
async getNodeProperty(nodeId: string, property: string): Promise<string> {
|
||||
try {
|
||||
const node = await this.getNodeById(nodeId);
|
||||
return (node.entry.properties && node.entry.properties[property]) || '';
|
||||
return (node.entry.properties?.[property]) || '';
|
||||
} catch (error) {
|
||||
Logger.error(`${this.constructor.name} ${this.getNodeProperty.name}`, error);
|
||||
return '';
|
||||
|
Reference in New Issue
Block a user