Skip to content

Commit

Permalink
Merge pull request #36 from basiqio-oss/DX-666-av-starter-kit-update-…
Browse files Browse the repository at this point in the history
…handle-job-id-job-ids

DX-666 Update jobIds Handler
  • Loading branch information
basiq-chris authored Apr 24, 2024
2 parents 4196b60 + ad5a5c8 commit c6f4fa3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function useBasiqConnection({ currentStep, userId }) {
}

async function createBasiqConnection() {
let newJobId = new URLSearchParams(window.location.search).get("jobId");
let newJobId = new URLSearchParams(window.location.search).get("jobIds");
setInProgress(true);
// Optimisic UI. We know the first job basiq will process will always be "verify-credentials"
setStepNameInProgress('verify-credentials');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,25 @@ export function AccountVerificationFormStep3LoadingSteps() {
const { error, progress, completed, stepNameInProgress, reset, setJobId } = basiqConnection;

useEffect(() => {
const newJobId = new URLSearchParams(window.location.search).get("jobId");
const newJobId = new URLSearchParams(window.location.search).get("jobIds");
console.log(newJobId);
setJobId(newJobId);
// Regular expression to match UUIDs separated by commas
if (newJobId) {
// Regular expression to match UUIDs separated by commas
const uuidRegex = /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/g;

// Extracting all UUIDs from the string
const uuids = newJobId.match(uuidRegex);

if (uuids && uuids.length > 0) {
// Extracting the first UUID
const firstUUID = uuids[0];
setJobId(firstUUID);
} else {
setJobId(newJobId);
}
}

}, [])

return (
Expand Down

0 comments on commit c6f4fa3

Please sign in to comment.