refactor: Extract iconUrl generation of steps to helper
This commit is contained in:
7
packages/backend/src/helpers/generate-icon-url.js
Normal file
7
packages/backend/src/helpers/generate-icon-url.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import appConfig from '../config/app.js';
|
||||
|
||||
export const generateIconUrl = (appKey) => {
|
||||
if (!appKey) return null;
|
||||
|
||||
return `${appConfig.baseUrl}/apps/${appKey}/assets/favicon.svg`;
|
||||
};
|
||||
@@ -9,6 +9,7 @@ import appConfig from '../config/app.js';
|
||||
import globalVariable from '../helpers/global-variable.js';
|
||||
import computeParameters from '../helpers/compute-parameters.js';
|
||||
import testRun from '../services/test-run.js';
|
||||
import { generateIconUrl } from '../helpers/generate-icon-url.js';
|
||||
|
||||
class Step extends Base {
|
||||
static tableName = 'steps';
|
||||
@@ -88,9 +89,7 @@ class Step extends Base {
|
||||
}
|
||||
|
||||
get iconUrl() {
|
||||
if (!this.appKey) return null;
|
||||
|
||||
return `${appConfig.baseUrl}/apps/${this.appKey}/assets/favicon.svg`;
|
||||
return generateIconUrl(this.appKey);
|
||||
}
|
||||
|
||||
get isTrigger() {
|
||||
|
||||
Reference in New Issue
Block a user