Skip to content

Commit

Permalink
Merge pull request #58 from IntersectMBO/BugFix--#2544
Browse files Browse the repository at this point in the history
Bug fix  #2544
  • Loading branch information
nebojsact authored Dec 25, 2024
2 parents 500aedc + e37ef0d commit 5c471f8
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
6 changes: 2 additions & 4 deletions backend/src/api/poll-vote/controllers/poll-vote.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ module.exports = createCoreController(
async create(ctx) {
const { data } = ctx?.request?.body;
const { vote_result: voteResult, poll_id: pollId } = data;

const user = ctx?.state?.user;

if (!user) {
return ctx.badRequest(null, 'User is required');
}
Expand Down Expand Up @@ -51,7 +49,7 @@ module.exports = createCoreController(
user_id: user?.id
},
{
poll_Id: pollId
poll_id: pollId
}
]}
})
Expand Down Expand Up @@ -261,4 +259,4 @@ module.exports = createCoreController(
}
},
})
);
);
6 changes: 5 additions & 1 deletion backend/src/api/poll/controllers/poll.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ module.exports = createCoreController('api::poll.poll', ({ strapi }) => ({
{
return ctx.badRequest(null, 'User is not owner of this proposal');
}

const currentActivePool = await strapi.entityService.findMany("api::poll.poll",{filters:{$and:[{proposal_id:data.proposal_id},{is_poll_active:true}]},limit:1});
if(currentActivePool.length > 0)
{
return ctx.badRequest(null, 'There is already an active pool for this proposal');
}
const newPool = await strapi.entityService.create("api::poll.poll",{data:data});
return this.transformResponse(newPool);
}
Expand Down
9 changes: 9 additions & 0 deletions pdf-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
As a minor extension, we also keep a semantic version for the `UNRELEASED`
changes.

## [v0.5.6](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/0.5.6) 2024-12-28
### Added -
### Fixed
= Changed copy on landing page [Issue #2438](https://github.com/IntersectMBO/govtool/issues/2544)

### Changed -
### Removed -


## [v0.5.5](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/0.5.5) 2024-12-06

### Added -
Expand Down
4 changes: 2 additions & 2 deletions pdf-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pdf-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@intersect.mbo/pdf-ui",
"version": "0.5.5",
"version": "0.5.6",
"description": "Proposal discussion ui",
"main": "./src/index.js",
"exports": {
Expand Down
5 changes: 0 additions & 5 deletions pdf-ui/src/pages/IdentificationPage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ const IdentificationPage = ({ handleLogin }) => {
alignItems={'center'}
>
<Box textAlign={'center'} width={'100%'}>
<Typography variant='body1'>
This is a pre-release of the Proposal Discussion section of
Govtool.
</Typography>

<Typography
variant='body1'
sx={{
Expand Down

0 comments on commit 5c471f8

Please sign in to comment.