Skip to content

Commit

Permalink
Revert changed
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac committed Jun 9, 2024
1 parent 7d4addf commit 468064e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cypress/support/commands/rancher-api-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,18 +443,15 @@ Cypress.Commands.add('deleteRancherResource', (prefix, resourceType, resourceId,
/**
* create a v3 / v1 resource
*/
Cypress.Commands.add('createRancherResource', (prefix, resourceType, body?) => {
const url = !!body ? `${ prefix }/${ resourceType }` : prefix;
const b = !!body ? body : resourceType;

Cypress.Commands.add('createRancherResource', (prefix, resourceType, body) => {
return cy.request({
method: 'POST',
url: `${ Cypress.env('api') }/${ url }`,
url: `${ Cypress.env('api') }/${ prefix }/${ resourceType }`,
headers: {
'x-api-csrf': token.value,
Accept: 'application/json'
},
body: b
body
})
.then((resp) => {
// Expect 201, Created HTTP status code
Expand Down

0 comments on commit 468064e

Please sign in to comment.