Skip to content

Commit

Permalink
chore: format-all
Browse files Browse the repository at this point in the history
  • Loading branch information
richardtreier committed Jan 16, 2024
1 parent 0dda8d3 commit fa465c4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function patchAsset(assetId: string, patcher: Patcher<UiAsset>): UiAsset {

export const createAsset = (asset: UiAssetCreateRequest): IdResponseDto => {
assets.push({
..._metadata(asset.id, asset),
...metadata(asset.id, asset),
connectorEndpoint: 'https://my-connector/api/dsp',
participantId: 'MDSL1234XX.C1234XX',
creatorOrganizationName: 'My Org',
Expand All @@ -43,15 +43,15 @@ export const editAssetMetadata = (
assetId: string,
request: UiAssetEditMetadataRequest,
): IdResponseDto => {
const asset = patchAsset(assetId, () => _metadata(assetId, request));
const asset = patchAsset(assetId, () => metadata(assetId, request));

return {
id: asset.assetId,
lastUpdatedDate: new Date(),
};
};

function _metadata(
function metadata(
assetId: string,
request: UiAssetCreateRequest | UiAssetEditMetadataRequest,
) {
Expand Down
6 changes: 3 additions & 3 deletions src/app/core/services/asset-create-request-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class AssetCreateRequestBuilder {
buildAssetCreateRequest(
formValue: AssetEditorDialogFormValue,
): UiAssetCreateRequest {
const metadata = this._metadata(formValue);
const metadata = this.buildMetadata(formValue);
const dataAddressProperties =
this.dataAddressMapper.buildDataAddressProperties(formValue.datasource);

Expand All @@ -32,11 +32,11 @@ export class AssetCreateRequestBuilder {
buildEditMetadataRequest(
formValue: AssetEditorDialogFormValue,
): UiAssetEditMetadataRequest {
const {id, ...metadata} = this._metadata(formValue);
const {id, ...metadata} = this.buildMetadata(formValue);
return metadata;
}

private _metadata(
private buildMetadata(
formValue: AssetEditorDialogFormValue,
): Omit<UiAssetCreateRequest, 'dataAddressProperties'> {
const id = formValue.metadata?.id!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {ValidationMessages} from '../../../../core/validators/validation-message
import {AssetEditDialogData} from './asset-edit-dialog-data';
import {AssetEditDialogResult} from './asset-edit-dialog-result';
import {AssetAdvancedFormBuilder} from './form/asset-advanced-form-builder';
import {AssetEditDialogForm} from './form/asset-edit-dialog-form';
import {AssetDatasourceFormBuilder} from './form/asset-datasource-form-builder';
import {AssetEditDialogForm} from './form/asset-edit-dialog-form';
import {AssetMetadataFormBuilder} from './form/asset-metadata-form-builder';
import {AssetEditorDialogFormValue} from './form/model/asset-editor-dialog-form-model';

Expand Down

0 comments on commit fa465c4

Please sign in to comment.