Skip to content

Commit

Permalink
fix(project): modify endpoint body type (#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
agong-coveo authored Jun 4, 2024
1 parent 82c82ff commit a10904a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/resources/Projects/ProjectInterfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ export interface UpdatedProjectResourceAssociationsModel {
/**
* Project-resource associations to be added
*/
additions: UpdatedProjectAssociationsModel[];
additions: UpdatedProjectAssociationsModel;
/**
* Project-resource associations to be removed
*/
removals: UpdatedProjectAssociationsModel[];
removals: UpdatedProjectAssociationsModel;
}
13 changes: 6 additions & 7 deletions src/resources/Projects/tests/Project.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
BaseProjectModel,
ProjectModel,
ProjectType,
UpdatedProjectAssociationsModel,
UpdatedProjectResourceAssociationsModel,
} from '../ProjectInterfaces.js';

Expand Down Expand Up @@ -140,13 +141,11 @@ describe('Project', () => {
describe('updateProjectResourceAssociation', () => {
it('should make a PUT call to the correct Project URL', () => {
const randomProjectResourceAssociation: UpdatedProjectResourceAssociationsModel = {
additions: [
{
projectIds: ['random-project-id'],
resourceIds: ['random-source-id'],
},
],
removals: [],
additions: {
projectIds: ['random-project-id'],
resourceIds: ['random-source-id'],
},
removals: {} as UpdatedProjectAssociationsModel,
};
project.updateProjectResourceAssociation('SOURCE', randomProjectResourceAssociation);
expect(api.put).toHaveBeenCalledTimes(1);
Expand Down

0 comments on commit a10904a

Please sign in to comment.