Skip to content

Commit

Permalink
Remove modelId parameter from setModelDataType method
Browse files Browse the repository at this point in the history
  • Loading branch information
Jondyr committed Dec 18, 2024
1 parent 58884cd commit d3374b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions backend/src/Designer/Controllers/DatamodelsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ public async Task<IActionResult> GetModelDataType(string org, string repository,
/// </summary>
[HttpPut("datamodel/{modelName}/dataType")]
[UseSystemTextJson]
public async Task SetModelDataType(string org, string repository, string modelName, [FromBody] DataType dataType)
public async Task SetModelDataType(string org, string repository, [FromBody] DataType dataType)
{
await _schemaModelService.SetModelDataType(org, repository, modelName, dataType);
await _schemaModelService.SetModelDataType(org, repository, dataType);
}

private static string GetFileNameFromUploadedFile(IFormFile thefile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,10 @@ public async Task<DataType> GetModelDataType(string org, string app, string mode
return dataType;
}

public async Task SetModelDataType(string org, string app, string modelId, DataType dataType)
public async Task SetModelDataType(string org, string app, DataType dataType)
{
ApplicationMetadata applicationMetadata = await _applicationMetadataService.GetApplicationMetadataFromRepository(org, app);
applicationMetadata.DataTypes.RemoveAll((dataType) => dataType.Id == modelId);
applicationMetadata.DataTypes.RemoveAll((dt) => dt.Id == dataType.Id);
applicationMetadata.DataTypes.Add(dataType);
await _applicationMetadataService.UpdateApplicationMetaDataLocally(org, app, applicationMetadata);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ public interface ISchemaModelService
/// <summary>
/// Updates the dataType for a given model.
/// </summary>
Task SetModelDataType(string org, string app, string modelId, DataType dataType);
Task SetModelDataType(string org, string app, DataType dataType);
}
}

0 comments on commit d3374b5

Please sign in to comment.