Commit cab75d57 authored by Paul Gascou-Vaillancourt's avatar Paul Gascou-Vaillancourt Committed by Simon Knox

Realign DAST site validation frontend with backend

parent e8ee5540
...@@ -219,9 +219,7 @@ export default { ...@@ -219,9 +219,7 @@ export default {
try { try {
const { const {
data: { data: {
project: { project: { dastSiteValidation },
dastSiteValidation: { status },
},
}, },
} = await this.$apollo.query({ } = await this.$apollo.query({
query: dastSiteValidationQuery, query: dastSiteValidationQuery,
...@@ -231,7 +229,7 @@ export default { ...@@ -231,7 +229,7 @@ export default {
}, },
fetchPolicy: fetchPolicies.NETWORK_ONLY, fetchPolicy: fetchPolicies.NETWORK_ONLY,
}); });
this.validationStatus = status; this.validationStatus = dastSiteValidation?.status || null;
if (this.validationStatusMatches(INPROGRESS)) { if (this.validationStatusMatches(INPROGRESS)) {
await new Promise(resolve => { await new Promise(resolve => {
...@@ -259,7 +257,7 @@ export default { ...@@ -259,7 +257,7 @@ export default {
} = await this.$apollo.mutate({ } = await this.$apollo.mutate({
mutation: dastSiteTokenCreateMutation, mutation: dastSiteTokenCreateMutation,
variables: { variables: {
projectFullPath: this.fullPath, fullPath: this.fullPath,
targetUrl: this.form.fields.targetUrl.value, targetUrl: this.form.fields.targetUrl.value,
}, },
}); });
......
mutation dastSiteTokenCreate($projectFullPath: ID!, $targetUrl: String!) { mutation dastSiteTokenCreate($fullPath: ID!, $targetUrl: String!) {
dastSiteTokenCreate(input: { projectFullPath: $projectFullPath, targetUrl: $targetUrl }) { dastSiteTokenCreate(input: { fullPath: $fullPath, targetUrl: $targetUrl }) {
id id
token token
errors errors
......
...@@ -237,7 +237,7 @@ describe('DastSiteProfileForm', () => { ...@@ -237,7 +237,7 @@ describe('DastSiteProfileForm', () => {
await waitForPromises(); await waitForPromises();
expect(requestHandlers.dastSiteTokenCreate).toHaveBeenCalledWith({ expect(requestHandlers.dastSiteTokenCreate).toHaveBeenCalledWith({
projectFullPath: fullPath, fullPath,
targetUrl, targetUrl,
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment