Skip to content

Commit

Permalink
fix(SRC-5281): drop call that was removed (#873)
Browse files Browse the repository at this point in the history
fix(SRC-5281)!: drop call that was removed
  • Loading branch information
mtmustapha-coveo authored Oct 10, 2024
1 parent 72f75d2 commit 2c51527
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 43 deletions.
18 changes: 0 additions & 18 deletions src/resources/Projects/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
BaseProjectModel,
ProjectResourceType,
ListAssociatedProjectsModel,
UpdatedProjectResourceAssociationsModel,
} from './ProjectInterfaces.js';

export default class Project extends Resource {
Expand Down Expand Up @@ -110,21 +109,4 @@ export default class Project extends Resource {
resourceIds,
);
}

/**
* Modifies project-resource associations and returns a list of updated projects.
*
* @param {ProjectResourceType} resourceType
* @param {UpdatedProjectResourceAssociationsModel} updatedProjectResourceAssociation
* @returns {Promise<ProjectModel[]>} Returns a list of updated projects.
*/
updateProjectResourceAssociation(
resourceType: ProjectResourceType,
updatedProjectResourceAssociation: UpdatedProjectResourceAssociationsModel,
): Promise<ProjectModel[]> {
return this.api.put<ProjectModel[]>(
this.buildPath(`${Project.baseUrl}/resources/modify/${resourceType}`),
updatedProjectResourceAssociation,
);
}
}
26 changes: 1 addition & 25 deletions src/resources/Projects/tests/Project.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import API from '../../../APICore.js';
import Project from '../Project.js';
import {
BaseProjectModel,
ProjectModel,
ProjectType,
UpdatedProjectAssociationsModel,
UpdatedProjectResourceAssociationsModel,
} from '../ProjectInterfaces.js';
import {BaseProjectModel, ProjectModel, ProjectType} from '../ProjectInterfaces.js';

jest.mock('../../../APICore.js');

Expand Down Expand Up @@ -137,22 +131,4 @@ 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: {} as UpdatedProjectAssociationsModel,
};
project.updateProjectResourceAssociation('SOURCE', randomProjectResourceAssociation);
expect(api.put).toHaveBeenCalledTimes(1);
expect(api.put).toHaveBeenCalledWith(
`${Project.baseUrl}/resources/modify/SOURCE`,
randomProjectResourceAssociation,
);
});
});
});

0 comments on commit 2c51527

Please sign in to comment.