Skip to content

Commit

Permalink
console log cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ipula committed Oct 24, 2024
1 parent eb62819 commit c0e2de4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
7 changes: 1 addition & 6 deletions src/pages/acceptInvitation/AcceptInvitationPageStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export const useAcceptInvitationPageStore = defineComponentStore(

function updateAcceptInvitationPayload(fieldName, value) {
acceptInvitationPayload.value[fieldName] = value;
console.log(acceptInvitationPayload.value);
}

/** Steps */
Expand Down Expand Up @@ -272,11 +271,7 @@ export const useAcceptInvitationPageStore = defineComponentStore(

const invitationRequestPayload = computed(() => {
let payload = {};
if (userId.value && acceptInvitationPayload.value.userOrcid) {
payload = {
userOrcid: acceptInvitationPayload.value.userOrcid,
};
} else {
if (!userId.value) {
if (currentStep.value) {
currentStep.value.sections.forEach((element, index) => {
let sectionPayload = {};
Expand Down
18 changes: 9 additions & 9 deletions src/pages/userInvitation/UserInvitationPageStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ export const useUserInvitationPageStore = defineComponentStore(
invitationPayload.value[fieldName] = value;
if (!initialValue) {
updatedPayload.value[fieldName] = value;
}
// when user type and remove the values, updated fields should remove from the payloads
if (
!invitationPayload.value.userId &&
typeof value === 'object' &&
Object.keys(value).length === 0
) {
delete invitationPayload.value[fieldName];
delete updatedPayload.value[fieldName];
// when user type and remove the values, updated fields should remove from the payloads
if (
value !== null &&
typeof value === 'object' &&
Object.keys(value).length === 0
) {
delete invitationPayload.value[fieldName];
delete updatedPayload.value[fieldName];
}
}
}

Expand Down

0 comments on commit c0e2de4

Please sign in to comment.