Skip to content

Commit 09db0cb

Browse files
authored
Merge pull request #61 from IntersectMBO/BugFix-2495
IPFS URL Format support
2 parents cb7af3a + 5ab4599 commit 09db0cb

File tree

7 files changed

+21
-14
lines changed

7 files changed

+21
-14
lines changed

backend/src/api/poll-vote/controllers/poll-vote.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ module.exports = createCoreController(
1313
async create(ctx) {
1414
const { data } = ctx?.request?.body;
1515
const { vote_result: voteResult, poll_id: pollId } = data;
16-
1716
const user = ctx?.state?.user;
18-
1917
if (!user) {
2018
return ctx.badRequest(null, 'User is required');
2119
}
@@ -51,7 +49,7 @@ module.exports = createCoreController(
5149
user_id: user?.id
5250
},
5351
{
54-
poll_Id: pollId
52+
poll_id: pollId
5553
}
5654
]}
5755
})
@@ -261,4 +259,4 @@ module.exports = createCoreController(
261259
}
262260
},
263261
})
264-
);
262+
);

backend/src/api/poll/controllers/poll.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ module.exports = createCoreController('api::poll.poll', ({ strapi }) => ({
1717
{
1818
return ctx.badRequest(null, 'User is not owner of this proposal');
1919
}
20-
20+
const currentActivePool = await strapi.entityService.findMany("api::poll.poll",{filters:{$and:[{proposal_id:data.proposal_id},{is_poll_active:true}]},limit:1});
21+
if(currentActivePool.length > 0)
22+
{
23+
return ctx.badRequest(null, 'There is already an active pool for this proposal');
24+
}
2125
const newPool = await strapi.entityService.create("api::poll.poll",{data:data});
2226
return this.transformResponse(newPool);
2327
}

pdf-ui/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
As a minor extension, we also keep a semantic version for the `UNRELEASED`
99
changes.
1010

11+
## [v0.5.6](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/0.5.6) 2025-01-09
12+
### Added -
13+
### Fixed
14+
- Changed copy on landing page [Issue #2438](https://github.com/IntersectMBO/govtool/issues/2544)
15+
- Fixed support for IPFS [Issue #2438](https://github.com/IntersectMBO/govtool/issues/2495)
16+
17+
### Changed -
18+
### Removed -
19+
20+
1121
## [v0.5.5](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/0.5.5) 2024-12-06
1222

1323
### Added -

pdf-ui/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pdf-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@intersect.mbo/pdf-ui",
3-
"version": "0.5.5",
3+
"version": "0.5.6",
44
"description": "Proposal discussion ui",
55
"main": "./src/index.js",
66
"exports": {

pdf-ui/src/lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
} from '@emurgo/cardano-serialization-lib-asmjs';
66

77
export const URL_REGEX =
8-
/^(?:(?:https?:\/\/)?(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,})(?:\/[^\s]*)?)|(?:ipfs:\/\/[a-f0-9]+(?:\/[a-zA-Z0-9_]+)*)$|^$/;
8+
/^(?:(?:https?:\/\/)?(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,})(?:\/[^\s]*)?)|(?:ipfs:\/\/(?:[a-zA-Z0-9]+(?:\/[a-zA-Z0-9._-]+)*))$|^$/;
99

1010
export const formatIsoDate = (isoDate) => {
1111
if (!isoDate) return '';

pdf-ui/src/pages/IdentificationPage/index.jsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ const IdentificationPage = ({ handleLogin }) => {
1212
alignItems={'center'}
1313
>
1414
<Box textAlign={'center'} width={'100%'}>
15-
<Typography variant='body1'>
16-
This is a pre-release of the Proposal Discussion section of
17-
Govtool.
18-
</Typography>
19-
2015
<Typography
2116
variant='body1'
2217
sx={{

0 commit comments

Comments
 (0)