mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #18424 from overleaf/ii-delete-with-body-fe
[web] Replace delete with post requests when having body (FE) GitOrigin-RevId: df727f35ea77eaa8273687f75aafd9bd983b7f25
This commit is contained in:
parent
7ca9a5b61b
commit
d56f5a3030
2 changed files with 11 additions and 8 deletions
|
@ -42,7 +42,7 @@ export function removeProjectFromTag(tagId: string, projectId: string) {
|
|||
}
|
||||
|
||||
export function removeProjectsFromTag(tagId: string, projectIds: string[]) {
|
||||
return deleteJSON(`/tag/${tagId}/projects`, {
|
||||
return postJSON(`/tag/${tagId}/projects/remove`, {
|
||||
body: {
|
||||
projectIds,
|
||||
},
|
||||
|
|
|
@ -682,8 +682,8 @@ describe('<ProjectListRoot />', function () {
|
|||
})
|
||||
|
||||
it('opens the tags dropdown and remove a tag from selected projects', async function () {
|
||||
const deleteProjectsFromTagMock = fetchMock.delete(
|
||||
`express:/tag/:id/projects`,
|
||||
const deleteProjectsFromTagMock = fetchMock.post(
|
||||
`express:/tag/:id/projects/remove`,
|
||||
{
|
||||
status: 204,
|
||||
}
|
||||
|
@ -702,11 +702,14 @@ describe('<ProjectListRoot />', function () {
|
|||
await fetchMock.flush(true)
|
||||
|
||||
expect(
|
||||
deleteProjectsFromTagMock.called(`/tag/${this.tagId}/projects`, {
|
||||
deleteProjectsFromTagMock.called(
|
||||
`/tag/${this.tagId}/projects/remove`,
|
||||
{
|
||||
body: {
|
||||
projectIds: [projectsData[0].id, projectsData[1].id],
|
||||
},
|
||||
})
|
||||
}
|
||||
)
|
||||
).to.be.true
|
||||
screen.getByRole('button', { name: `${this.tagName} (0)` })
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue