diff --git a/backend/src/services/release.ts b/backend/src/services/release.ts index 94518f064..ed24957e3 100644 --- a/backend/src/services/release.ts +++ b/backend/src/services/release.ts @@ -197,7 +197,10 @@ export async function updateRelease(user: UserInterface, modelId: string, semver }) } - const updatedRelease = await Release.findOneAndUpdate({ modelId, semver }, { $set: release }) + const updatedRelease = await Release.findOneAndUpdate( + { modelId, semver: semverStringToObject(semver) }, + { $set: release }, + ) if (!updatedRelease) { throw NotFound(`The requested release was not found.`, { modelId, semver }) diff --git a/backend/test/services/release.spec.ts b/backend/test/services/release.spec.ts index bc2dd2b72..6d6d241e6 100644 --- a/backend/test/services/release.spec.ts +++ b/backend/test/services/release.spec.ts @@ -361,7 +361,6 @@ describe('services > release', () => { expect(releaseModelMocks.sort.mock.calls.at(0)).toMatchSnapshot() expect(releaseModelMocks.lookup.mock.calls.at(0)).toMatchSnapshot() expect(releaseModelMocks.append.mock.calls.at(0)).toMatchSnapshot() - // expect(releaseModelMocks.lookup.mock.calls.at(0)).toMatchSnapshot() }) //test good - give good semver range with lower and upper bounds, returns valid query