Skip to content

Commit

Permalink
Changed response to only the ff object (#1652)
Browse files Browse the repository at this point in the history
* Changed response to only the ff object

* make same change for frontend

---------

Co-authored-by: danoswaltCL <[email protected]>
Co-authored-by: danoswaltCL <[email protected]>
  • Loading branch information
3 people authored Jun 18, 2024
1 parent f6fd79f commit 607014e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class FeatureFlagRepository extends Repository<FeatureFlag> {
throw errorMsgString;
});

return result.raw;
return result.raw[0];
}

public async updateFeatureFlag(flagDoc: Partial<FeatureFlag>, entityManager: EntityManager): Promise<FeatureFlag> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ describe('FeatureFlagRepository Testing', () => {
sinon.assert.calledOnce(createQueryBuilderStub);
updateMock.verify();

expect(res).toEqual([flag]);
expect(res).toEqual(flag);
});

it('should throw an error when update flag fails', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const reducer = createReducer(
isLoadingUpdateFeatureFlagStatus: true,
})),
on(FeatureFlagsActions.actionEnableFeatureFlagSuccess, (state, { response }) => {
const flag = response[0];
const flag = response;
return adapter.updateOne(
{ id: flag?.id, changes: { status: flag?.status } },
{ ...state, isLoadingUpdateFeatureFlagStatus: false }
Expand Down

0 comments on commit 607014e

Please sign in to comment.