diff --git a/backend/src/api/poll-vote/controllers/poll-vote.js b/backend/src/api/poll-vote/controllers/poll-vote.js index 92e3f6a..8e82cc1 100644 --- a/backend/src/api/poll-vote/controllers/poll-vote.js +++ b/backend/src/api/poll-vote/controllers/poll-vote.js @@ -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'); } @@ -51,7 +49,7 @@ module.exports = createCoreController( user_id: user?.id }, { - poll_Id: pollId + poll_id: pollId } ]} }) @@ -261,4 +259,4 @@ module.exports = createCoreController( } }, }) -); +); \ No newline at end of file diff --git a/backend/src/api/poll/controllers/poll.js b/backend/src/api/poll/controllers/poll.js index 8fb9887..af5413f 100644 --- a/backend/src/api/poll/controllers/poll.js +++ b/backend/src/api/poll/controllers/poll.js @@ -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); } diff --git a/pdf-ui/CHANGELOG.md b/pdf-ui/CHANGELOG.md index c2fc4c0..c48bec5 100644 --- a/pdf-ui/CHANGELOG.md +++ b/pdf-ui/CHANGELOG.md @@ -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 - diff --git a/pdf-ui/package-lock.json b/pdf-ui/package-lock.json index 32b2cd4..a28e9ec 100644 --- a/pdf-ui/package-lock.json +++ b/pdf-ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "@intersect.mbo/pdf-ui", - "version": "0.5.5", + "version": "0.5.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@intersect.mbo/pdf-ui", - "version": "0.5.4", + "version": "0.5.6", "dependencies": { "@emurgo/cardano-serialization-lib-asmjs": "^12.0.0-beta.2", "@fontsource/poppins": "^5.0.14", diff --git a/pdf-ui/package.json b/pdf-ui/package.json index ba2a921..fc2f043 100644 --- a/pdf-ui/package.json +++ b/pdf-ui/package.json @@ -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": { diff --git a/pdf-ui/src/pages/IdentificationPage/index.jsx b/pdf-ui/src/pages/IdentificationPage/index.jsx index 83849b2..e5d2a68 100644 --- a/pdf-ui/src/pages/IdentificationPage/index.jsx +++ b/pdf-ui/src/pages/IdentificationPage/index.jsx @@ -12,11 +12,6 @@ const IdentificationPage = ({ handleLogin }) => { alignItems={'center'} > - - This is a pre-release of the Proposal Discussion section of - Govtool. - -