Skip to content

Commit

Permalink
MR API patch error fix (#3411)
Browse files Browse the repository at this point in the history
* api patch error fix

* tests fix
  • Loading branch information
YuliaKrimerman authored Oct 31, 2024
1 parent d1ee01b commit 40fa17e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ describe('Model version details', () => {
cy.wait('@updateModelFormat').then((interception) => {
expect(interception.request.body).to.deep.equal({
modelFormatName: 'UpdatedFormat',
artifactType: 'model-artifact',
});
});
});
Expand All @@ -439,6 +440,7 @@ describe('Model version details', () => {
cy.wait('@updateModelVersion').then((interception) => {
expect(interception.request.body).to.deep.equal({
modelFormatVersion: '2.0.0',
artifactType: 'model-artifact',
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ const ModelVersionDetailsView: React.FC<ModelVersionDetailsViewProps> = ({
value={modelArtifact?.modelFormatName || ''}
saveEditedValue={(value) =>
apiState.api
.patchModelArtifact({}, { modelFormatName: value }, modelArtifact?.id || '')
.patchModelArtifact(
{},
{ modelFormatName: value, artifactType: modelArtifact?.artifactType },
modelArtifact?.id || '',
)
.then(() => {
refreshModelArtifacts();
})
Expand All @@ -183,7 +187,11 @@ const ModelVersionDetailsView: React.FC<ModelVersionDetailsViewProps> = ({
isArchive={isArchiveVersion}
saveEditedValue={(newVersion) =>
apiState.api
.patchModelArtifact({}, { modelFormatVersion: newVersion }, modelArtifact?.id || '')
.patchModelArtifact(
{},
{ modelFormatVersion: newVersion, artifactType: modelArtifact?.artifactType },
modelArtifact?.id || '',
)
.then(() => {
refreshModelArtifacts();
})
Expand Down

0 comments on commit 40fa17e

Please sign in to comment.