Skip to content

Commit 50c88d9

Browse files
authored
Merge pull request #265 from IntersectMBO/Fix-for-creatig-Budget-Discussion-#3644
Fix for creatig Budget Discussion #3644
2 parents 0830ebc + 54f8eec commit 50c88d9

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

backend/src/api/bd-contact-information/content-types/bd-contact-information/lifecycles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = {
3535

3636
if (!data) return;
3737

38-
const bdId = data.bd;
38+
const bdId = data?.bd;
3939

4040
if (!bdId) return;
4141

backend/src/api/bd-costing/content-types/bd-costing/lifecycles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = {
3232
const { data } = event.params;
3333
if (!data) return;
3434

35-
const bdId = data.bd;
35+
const bdId = data?.bd;
3636

3737
if (!bdId) return;
3838

backend/src/api/bd-poll-vote/content-types/bd-poll-vote/lifecycles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async function isVotingLockedFromPoolId(bd_poll_id) {
2121
module.exports = {
2222
async beforeCreate(event) {
2323
const { data } = event.params;
24-
const isLocked = await isVotingLockedFromPoolId(data.bd_poll_id);
24+
const isLocked = await isVotingLockedFromPoolId(data?.bd_poll_id);
2525
if (isLocked) {
2626
throw new ValidationError('Creating poll votes is not allowed after the proposal has been submitted for voting.');
2727
}

backend/src/api/bd-poll/content-types/bd-poll/lifecycles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = {
3232
},
3333
async beforeCreate(event) {
3434
const { data } = event;
35-
const bdId = data.bd_proposal_id;
35+
const bdId = data?.bd_proposal_id;
3636
if (!bdId) return;
3737
const relatedBd = await strapi.entityService.findOne('api::bd.bd', bdId, {
3838
fields: ['submitted_for_vote'],

0 commit comments

Comments
 (0)